[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/sched: fix get_cpu_idle_time() for smt=0 suspend/resume


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Aug 2021 12:35:31 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kVWzZxAB7LAzqC0qgn38zHai6yuvntAGHwddmsGZdjY=; b=dBEqviUqIE2WAOO1iYxpyQEnennJz+V8Rvqyjxg/Xh3fqBKU+wceV39itq0SoGNiRdTn2d2XNbc4gD2jWtPUwFzPBfSFl8ERim/jv4KTTz+gdSvNO4unh9U9MvuXm5FcKuMf7OtvDVkX0rtRrcx7x06X0ZE/w0zOkyXB/jY2F0ffxHfwqpewfr3tK7Ux6pBffHvlYgphFLwmonbmFP91ZYDQ5RTe01MHFStaCttZOzinaZp2cZ/nxCKZZn63HD/9iYlYJQ9Ol1SIci09WvS7p8sn4ZIpuC68Iew9I7nPI4qEu+IzZ8IiDFtd9N18R/yq9fiCfv+LkqTzTim2kb4p+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsJ+/hBZoyJ01V8+ux2Zh30uSuNo5/pdMdfjOJ/EKyriDCCdRwYl8VH1LlOYX2qy+95swFT0hmxwVSNMSeMCRwGILDQKVcHB4YwVZcxwnNoxrrNCEpm/Vn1Pgxi1bzXkp5F5lyKiYfCd49CN3RO8qZepz+v3v2svwEKP7tmWDjnaOJgDVJp5Z8qXlvGOMPHBoVRdnh7P5L5x5FvKevM5Dt6HN6/ji9B2Pb+liaW7RF10RQ3urSFpv11mEscbxRRxnqAQgh7RpNz8gfHyVENWZrnXSIMjP2fQA+e2sY/4R5YOcWtvBy/sU3wBOIziCYqvE1H93Afn/61340lZu1nu6A==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 Aug 2021 10:35:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.08.2021 12:21, Juergen Gross wrote:
> With smt=0 during a suspend/resume cycle of the machine the threads
> which have been parked before will briefly come up again. This can
> result in problems e.g. with cpufreq driver being active as this will
> call into get_cpu_idle_time() for a cpu without initialized scheduler
> data.
> 
> Fix that by letting get_cpu_idle_time() deal with this case.
> 
> Fixes: 132cbe8f35632fb2 ("sched: fix get_cpu_idle_time() with core 
> scheduling")
> Reported-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> Tested-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> --- a/xen/common/sched/core.c
> +++ b/xen/common/sched/core.c
> @@ -337,7 +337,7 @@ uint64_t get_cpu_idle_time(unsigned int cpu)
>      struct vcpu_runstate_info state = { 0 };
>      const struct vcpu *v = idle_vcpu[cpu];
>  
> -    if ( cpu_online(cpu) && v )
> +    if ( cpu_online(cpu) && v && get_sched_res(cpu) )
>          vcpu_runstate_get(v, &state);

My earlier question was aiming at getting rid of the (now) middle part
of the condition; I thought this may be okay to do as a secondary change
here. But perhaps you intentionally left it there, so I'm unsure whether
to suggest to make the adjustment while committing (awaiting a
maintainer ack first anyway).

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.