From patchwork Mon Apr 8 02:40:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FionaLi-oc X-Patchwork-Id: 10888777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA2171708 for ; Mon, 8 Apr 2019 04:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97E10285B7 for ; Mon, 8 Apr 2019 04:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87C19285CC; Mon, 8 Apr 2019 04:47:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F1BB285B7 for ; Mon, 8 Apr 2019 04:47:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hDM9g-0001pQ-76; Mon, 08 Apr 2019 04:45:12 +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 1hDKE1-0000i2-GQ for xen-devel@lists.xenproject.org; Mon, 08 Apr 2019 02:41:33 +0000 X-Inumbo-ID: cdc2f632-59a7-11e9-b55b-dfed27b88b9f Received: from ZXSHCAS1.zhaoxin.com (unknown [203.148.12.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cdc2f632-59a7-11e9-b55b-dfed27b88b9f; Mon, 08 Apr 2019 02:41:28 +0000 (UTC) Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Mon, 8 Apr 2019 10:41:20 +0800 Received: from localhost.localdomain (10.29.8.62) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Mon, 8 Apr 2019 10:41:20 +0800 From: FionaLi-oc To: Date: Mon, 8 Apr 2019 10:40:46 +0800 Message-ID: <1554691246-7249-1-git-send-email-fionali-oc@zhaoxin.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.29.8.62] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Mailman-Approved-At: Mon, 08 Apr 2019 04:45:11 +0000 Subject: [Xen-devel] [PATCH] cpupool: fix ASSERT( c != old_pool ) 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: jgross@suse.com, cobechen@zhaoxin.com, FionaLi-oc , dfaggioli@suse.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Assigning cpu to cpupool needn't to switch cpu scheduler when system state is resume, otherwise it will cause ASSERT in schedule_cpu_switch(). Signed-off-by: FionaLi-oc --- xen/common/cpupool.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index e89bb67..acc4a52 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -268,9 +268,13 @@ static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu) if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) ) return -EADDRNOTAVAIL; - ret = schedule_cpu_switch(cpu, c); - if ( ret ) - return ret; + + if( system_state != SYS_STATE_resume ) + { + ret = schedule_cpu_switch(cpu, c); + if ( ret ) + return ret; + } cpumask_clear_cpu(cpu, &cpupool_free_cpus); if (cpupool_moving_cpu == cpu)