From nobody Mon Apr 29 15:02:27 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=1583831306; cv=none; d=zohomail.com; s=zohoarc; b=KucknilA2QmPTkOYt6GrdQcndgXMgXTSI4D+6Jn6cqbyO1RuytZ5Z3sqtn50GZBQi70RNpHl2IO20rijTNT3bwaIebHURKCna8ls7iGFcfea4cnoOymy19KWDhAcIaqhDExW+XaC8v+RbAQAdkonvAAtJjx1wF2v0oWSoKpxD24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583831306; 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=1GaLndSIs50odTdnKInEeCR/LjhlIkkjabJWtRLRoB8=; b=UEMVwl8eSHxujqs+/dRQwXOyf3LPRBfO/4exb22r8I3aQPcr5NXkeVoxFMqjwLETjejqRAl0laOKCRnAE3bgTZd9GL20tFAGoKTbdvA2VB4w001wqyHQIc46r/gd/m+r6ty0Ag+aXPoyoubyAEQjrKnePo365CZ4Cux7MryF0YU= 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 1583831306717837.096822403144; Tue, 10 Mar 2020 02:08:26 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jBare-0003aT-Ih; Tue, 10 Mar 2020 09:07:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jBarc-0003aO-LK for xen-devel@lists.xenproject.org; Tue, 10 Mar 2020 09:07:48 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9c2e20ea-62ae-11ea-8490-bc764e2007e4; Tue, 10 Mar 2020 09:07:47 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CF369AD46; Tue, 10 Mar 2020 09:07:46 +0000 (UTC) X-Inumbo-ID: 9c2e20ea-62ae-11ea-8490-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 10 Mar 2020 10:06:42 +0100 Message-Id: <20200310090642.8476-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v2] xen/sched: fix onlining cpu with core scheduling active 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When onlining a cpu cpupool_cpu_add() checks whether all siblings of the new cpu are free in order to decide whether to add it to cpupool0. In case the added cpu is not the last sibling to be onlined this test is wrong as it only checks for all online siblings to be free. The test should include the check for the number of siblings having reached the scheduling granularity of cpupool0, too. Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli --- V2: - modify condition form >=3D to =3D=3D (Jan Beulich) --- xen/common/sched/cpupool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index 9f70c7ec17..d40345b585 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -616,7 +616,8 @@ static int cpupool_cpu_add(unsigned int cpu) get_sched_res(cpu)->cpupool =3D NULL; =20 cpus =3D sched_get_opt_cpumask(cpupool0->gran, cpu); - if ( cpumask_subset(cpus, &cpupool_free_cpus) ) + if ( cpumask_subset(cpus, &cpupool_free_cpus) && + cpumask_weight(cpus) =3D=3D cpupool_get_granularity(cpupool0) ) ret =3D cpupool_assign_cpu_locked(cpupool0, cpu); =20 rcu_read_unlock(&sched_res_rculock); --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel