From nobody Thu May 2 03:02:14 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=1583238516; cv=none; d=zohomail.com; s=zohoarc; b=EgtxhKzuLRvJXhVegyq3fY+gHytLHBSAAAGi7nCKiZ2Y98XivoY0ylPuLKY1AvM3TcQEeMZCM+8l6fEgKJXEFAkCkjPA8exrD8j3Q1q4LbGuAjdkLdJ31ogzTYlRIuEIdda5qVvUINim2rpjPbAM2beAA2ypWN5VlWTsOfPE4bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583238516; 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=lPwfxRyd6Ro86qkO+JdWlP0/D2hB6nO2mf7NDy56Q70=; b=KQUFnXU+r7ag7GKHaDTz7t+TWNuzmbngzGrkMcyV+rw/XNoWEUYkdDx5gXCIa3RHyjM7oW4oBh27W/8UD+y8p0AalRi7fUWavVdRIKI6yAy6cr5iCH+Bzq8HpgvJXVeh5dGW8g8ejMpSpioUC0scW+d4euFfUaUwU1ZBVqI411E= 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 1583238516326561.0217422009779; Tue, 3 Mar 2020 04:28:36 -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 1j96eR-0004Ne-S0; Tue, 03 Mar 2020 12:27:55 +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 1j96eR-0004NZ-6P for xen-devel@lists.xenproject.org; Tue, 03 Mar 2020 12:27:55 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 67405ddb-5d4a-11ea-a14a-12813bfff9fa; Tue, 03 Mar 2020 12:27:53 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A7DD7ACD7; Tue, 3 Mar 2020 12:27:52 +0000 (UTC) X-Inumbo-ID: 67405ddb-5d4a-11ea-a14a-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 3 Mar 2020 13:27:50 +0100 Message-Id: <20200303122750.26996-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] 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 --- 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..4a67df8584 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 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