From nobody Sun Apr 28 19:17:02 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1578227665; cv=none; d=zohomail.com; s=zohoarc; b=i5yXMGhXFfyHkhrIzutj9CkuunciON0fuz3EozUaFl3W9HdV49gxPJuqnzEUxUcWj+gro8ogRoFNUKKlBOylOU6YIr4dz3wiYgNRKJFSGmewEIUYawmJSPOcDUo+CohI+RzXbjKES+B0OGAJMSL48lCi42gSb3YHvlbxERqRRtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578227665; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=OcpATuvF9/MTT/tpZiw8TS106E1RfjzvpCyNiJjH6BI=; b=i0edEiEDwz92o+5y32Je0Rw1LW0qcG6fki+A9/2+jKZJREI2KkIpGP8Y1nE67MmPV3tzrOG0g2SbC5UP8Td53A/EkJeCV67CMSn1GknnToDrk2Nveq3/weeT8b+6nWJlMPZGncrx4M1ng0IFb41PYlSRoX6Ir01/3TQRzlTxRwg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578227665814935.3476937867046; Sun, 5 Jan 2020 04:34:25 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1io560-00071i-Sc; Sun, 05 Jan 2020 12:33:28 +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.89) (envelope-from ) id 1io560-00071d-9f for xen-devel@lists.xenproject.org; Sun, 05 Jan 2020 12:33:28 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 91a3671a-2fb7-11ea-aa17-12813bfff9fa; Sun, 05 Jan 2020 12:33:26 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D2CBAAEC5; Sun, 5 Jan 2020 12:33:25 +0000 (UTC) X-Inumbo-ID: 91a3671a-2fb7-11ea-aa17-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Sun, 5 Jan 2020 13:33:23 +0100 Message-Id: <20200105123323.12492-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/sched: fix resuming from S3 with smt=0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , George Dunlap , Dario Faggioli Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When resuming from S3 and smt=3D0 or maxcpus=3D are specified we must not do anything in cpu_schedule_callback(). This is not true today for taking down a cpu during resume. If anything goes wrong during resume all the scheduler related error handling is in cpupool.c, so we can just bail out early from cpu_schedule_callback() when suspending or resuming. This fixes commit 0763cd2687897b55e7 ("xen/sched: don't disable scheduler on cpus during suspend"). Reported-by: Marek Marczykowski-G=C3=B3recki Tested-by: Marek Marczykowski-G=C3=B3recki Signed-off-by: Juergen Gross Acked-by: George Dunlap --- xen/common/schedule.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index e70cc70a65..54a07ff9e8 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -2562,6 +2562,13 @@ static int cpu_schedule_callback( unsigned int cpu =3D (unsigned long)hcpu; int rc =3D 0; =20 + /* + * All scheduler related suspend/resume handling needed is done in + * cpupool.c. + */ + if ( system_state > SYS_STATE_active ) + return NOTIFY_DONE; + rcu_read_lock(&sched_res_rculock); =20 /* @@ -2589,8 +2596,7 @@ static int cpu_schedule_callback( switch ( action ) { case CPU_UP_PREPARE: - if ( system_state !=3D SYS_STATE_resume ) - rc =3D cpu_schedule_up(cpu); + rc =3D cpu_schedule_up(cpu); break; case CPU_DOWN_PREPARE: rcu_read_lock(&domlist_read_lock); @@ -2598,13 +2604,10 @@ static int cpu_schedule_callback( rcu_read_unlock(&domlist_read_lock); break; case CPU_DEAD: - if ( system_state =3D=3D SYS_STATE_suspend ) - break; sched_rm_cpu(cpu); break; case CPU_UP_CANCELED: - if ( system_state !=3D SYS_STATE_resume ) - cpu_schedule_down(cpu); + cpu_schedule_down(cpu); break; default: break; --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel