Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1381EC4338F for ; Wed, 18 Aug 2021 10:12:55 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C3DB6103A for ; Wed, 18 Aug 2021 10:12:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8C3DB6103A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.168163.307009 (Exim 4.92) (envelope-from ) id 1mGIYk-0002F7-0u; Wed, 18 Aug 2021 10:12:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 168163.307009; Wed, 18 Aug 2021 10:12:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGIYj-0002F0-SP; Wed, 18 Aug 2021 10:12:33 +0000 Received: by outflank-mailman (input) for mailman id 168163; Wed, 18 Aug 2021 10:12:32 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGIYi-0002Eu-4E for xen-devel@lists.xenproject.org; Wed, 18 Aug 2021 10:12:32 +0000 Received: from wout5-smtp.messagingengine.com (unknown [64.147.123.21]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cc113c14-000c-11ec-a543-12813bfff9fa; Wed, 18 Aug 2021 10:12:30 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A038032008FE; Wed, 18 Aug 2021 06:12:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 18 Aug 2021 06:12:29 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Aug 2021 06:12:27 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cc113c14-000c-11ec-a543-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=sCajfi d2OmcBm3OIACz3F+0P88NFlDLda2u1HLFijaI=; b=qhV3dkPV8nGDSmTnSP1c/9 T/SqUHOwlpBJBdNN+bVi5TvSwxjsbjEUA2hxBZ+WmVUYBnqDogu6WSgOxmrU0P3s V+6kx0UVwR/hoVzy4/Fr99Y6Z1lR2UbJmypO93E05gIJ0H54jj+zHmg6EwVhcpvS JnfMBLatYBpx6T2nO3XyURIygsdWTlbkepI1lHJmCjD6Zftwo/uLxe39/LciOiYS n57TgWXAFgGpGIY+NdUXx9t3ICWlHXBXNWIpJQsc30y7WKWOZy3CkVYF+6nUJsIC EFWgrQVb1cVIWGoWxm+97o0zx3E+StmBMn8dlSqo6srvDgPj6yOW+cMFlricubuQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleehgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrrhgvkhcu ofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinhhvih hsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepheevvdeu veehkeehhfevgffggfevudegteeugfeliedvhefgueeiuefgteetieffnecuffhomhgrih hnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrg gsrdgtohhm X-ME-Proxy: Date: Wed, 18 Aug 2021 12:12:25 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: Jan Beulich , xen-devel , Andrew Cooper Subject: Re: S3 resume issue in cpufreq -> get_cpu_idle_time->vcpu_runstate_get Message-ID: References: <42948041-59a5-e243-ed39-6e2afe3fd1cd@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="axqHX3htufpSzeW/" Content-Disposition: inline In-Reply-To: --axqHX3htufpSzeW/ Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Aug 2021 12:12:25 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Juergen Gross Cc: Jan Beulich , xen-devel , Andrew Cooper Subject: Re: S3 resume issue in cpufreq -> get_cpu_idle_time->vcpu_runstate_get On Wed, Aug 18, 2021 at 08:24:39AM +0200, Juergen Gross wrote: > Marek, >=20 > On 17.08.21 17:15, Juergen Gross wrote: > > On 17.08.21 16:50, Marek Marczykowski-G=C3=B3recki wrote: > > I'll be looking into that. >=20 > Could you please try the attached patch? It works, thanks! So, the only other suspend-related issue I'm aware of, is: https://lore.kernel.org/xen-devel/20210131021526.GB6354@mail-itl/ But I don't have reliable reproducer for that one... > From e38d0816a33fbaa3c0c45bcd6e9d433b1e021222 Mon Sep 17 00:00:00 2001 > From: Juergen Gross > To: xen-devel@lists.xenproject.org > Cc: George Dunlap > Cc: Dario Faggioli > Date: Wed, 18 Aug 2021 08:18:20 +0200 > Subject: [PATCH] xen/sched: fix get_cpu_idle_time() for smt=3D0 suspend/r= esume > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit >=20 > With smt=3D0 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. >=20 > Fix that by letting get_cpu_idle_time() deal with this case. >=20 > Fixes: 132cbe8f35632fb2 ("sched: fix get_cpu_idle_time() with core schedu= ling") > Reported-by: Marek Marczykowski-G=C3=B3recki > Signed-off-by: Juergen Gross Tested-by: Marek Marczykowski-G=C3=B3recki > --- > An alternative way to fix the issue would be to keep the sched_resource > of offline cpus allocated like we already do with idle vcpus and units. > This fix would be more intrusive, but it would avoid similar other bugs > like this one. > --- > xen/common/sched/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c > index 6d34764d38..9ac1b01ca8 100644 > --- 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 =3D { 0 }; > const struct vcpu *v =3D idle_vcpu[cpu]; > =20 > - if ( cpu_online(cpu) && v ) > + if ( cpu_online(cpu) && v && get_sched_res(cpu) ) > vcpu_runstate_get(v, &state); > =20 > return state.time[RUNSTATE_running]; > --=20 > 2.26.2 >=20 --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --axqHX3htufpSzeW/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmEc3QkACgkQ24/THMrX 1yyX+gf/SxaLEAhmNLmKuWOzKe52OE7cK0qIk+dNRfuokpkliCkN2fOMTxN9UwWQ bn6vdtT8FufG0RclzKUJ/DHqdA51XAN61B/84Wr6dOb5j6sNa8KKhqeGqmfQySU2 m4/e2F09OpVLY4rXrxNJBnyTsd8vsXgjtgLym1R7jVkFYKYsgrhPOMDyU9N6vh91 +RcsMCKmtjN1TxFmxyyCqqhW3I8mf/2ybKRaKsKYDHKXMAY7d8IMikGd2dZVQT5F FHGf07r3inGsxBYo2e8ei2F21uxvbRCHeLm2Jl69WtXnDrie12vrfhskuIJb2Ve3 IrjOFr/bro0qgyJgHMuq3zsbWucZUA== =tem9 -----END PGP SIGNATURE----- --axqHX3htufpSzeW/--