From nobody Mon Feb 9 22:24:28 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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 (zoho.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=1559039731; cv=none; d=zoho.com; s=zohoarc; b=HxiMAE2DQ2CGQ1L8DqEw4Hm0TOTahi9lapp5he7aXEkqDuJzC/VT14Ffz2fgB0MxprbCU6A0SSV0BIghM9wOwzNSXctKx5qXGRNVdizohNibWUq3AgDwZbcGyD9S/NrWsQIpiPrIEeRetYECjKd+hGWxFgg7iPJNNvWrv7uHpRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559039731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=W1qZAB27daRJgLDeUXYK67EoB8mtsBrGfedEMGmlqms=; b=n+NEgLJWoPiy5XvXGwiodmPp50urP3m3pBttF4wYbAI7RPIlbZHoLjfFfua5Tgg2tmo+ZPDjpR7c/Zkn6mHC8QJ/t49pwDE8ypljW48Eu7LCOfaB0yHB6m11D0HH9F5Myv7svvJpGdDyvhsxSfoEn5ldzb5yKGRvZJsrR4bVs7c= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.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 155903973166211.54463030662987; Tue, 28 May 2019 03:35:31 -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 1hVZR4-0006ik-Db; Tue, 28 May 2019 10:34:26 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVZQG-0004x0-8s for xen-devel@lists.xenproject.org; Tue, 28 May 2019 10:33:36 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 090716df-8134-11e9-8980-bc764e045a96; Tue, 28 May 2019 10:33:30 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D0A37B08C for ; Tue, 28 May 2019 10:33:29 +0000 (UTC) X-Inumbo-ID: 090716df-8134-11e9-8980-bc764e045a96 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 28 May 2019 12:33:05 +0200 Message-Id: <20190528103313.1343-53-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190528103313.1343-1-jgross@suse.com> References: <20190528103313.1343-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 52/60] xen/sched: populate cpupool0 only after all cpus are up 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 , 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" With core or socket scheduling we need to know the number of siblings per scheduling unit before we can setup the scheduler properly. In order to prepare that do cpupool0 population only after all cpus are up. With that in place there is no need to create cpupool0 earlier, so do that just before assigning the cpus. Initialize free cpus with all online cpus at that time in order to be able to add the cpu notifier late, too. Signed-off-by: Juergen Gross --- V1: new patch --- xen/common/cpupool.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 403036c092..2a3e144700 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -775,18 +775,28 @@ static struct notifier_block cpu_nfb =3D { .notifier_call =3D cpu_callback }; =20 -static int __init cpupool_presmp_init(void) +static int __init cpupool_init(void) { + unsigned int cpu; int err; - void *cpu =3D (void *)(long)smp_processor_id(); + cpupool0 =3D cpupool_create(0, 0, &err); BUG_ON(cpupool0 =3D=3D NULL); cpupool_put(cpupool0); - cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); register_cpu_notifier(&cpu_nfb); + + spin_lock(&cpupool_lock); + + cpumask_copy(&cpupool_free_cpus, &cpu_online_map); + + for_each_cpu ( cpu, &cpupool_free_cpus ) + cpupool_assign_cpu_locked(cpupool0, cpu); + + spin_unlock(&cpupool_lock); + return 0; } -presmp_initcall(cpupool_presmp_init); +__initcall(cpupool_init); =20 /* * Local variables: --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel