From nobody Mon Feb 9 23:39:30 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=1568021693; cv=none; d=zoho.com; s=zohoarc; b=J87p3+1CyTNTUpJJRR1DHvAIPY4kWNcK9znJPI0Zwt1uDhBL1uMutNDyGuqUQouKSjTWjDTfiEw2+Mxl/Fq6gFa+VGfk6yn/xh4o0oESZC5tiRY8eOtfxxDj1bwcMlLbW5O0EZLieYFX8CJUpR/UuW3pIbojs8Etq2nHkqNqeGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568021693; 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=f1QTX/v3OSN6RMpRV606jPjQozpdk1iSO2iy/9j9QZQ=; b=ENUHCFRHySqDkuhrHP99URaXwhFlWCtboudwpmb/+SrNlFiR1iEHqInZeIuZBFHn7yNloYP1wX6v6s0uEpXr2Vi7dUuyFu3iZgJ8WZ/XPGGYlDJw0td6QOFvTcUkivCRy1wEXZZoMR9WDw41m4TYdq3QKjcNMWoKIE15WAq3fAE= 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 1568021693318824.6840044985425; Mon, 9 Sep 2019 02:34:53 -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 1i7G3N-0006W8-91; Mon, 09 Sep 2019 09:33:45 +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 1i7G3M-0006Vy-FM for xen-devel@lists.xenproject.org; Mon, 09 Sep 2019 09:33:44 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e96cb970-d2e4-11e9-ac09-12813bfff9fa; Mon, 09 Sep 2019 09:33:42 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D39BDB65E; Mon, 9 Sep 2019 09:33:41 +0000 (UTC) X-Inumbo-ID: e96cb970-d2e4-11e9-ac09-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 9 Sep 2019 11:33:36 +0200 Message-Id: <20190909093339.7134-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190909093339.7134-1-jgross@suse.com> References: <20190909093339.7134-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v3 1/4] 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" Simplify cpupool initialization by populating cpupool0 with cpus only after all cpus are up. This avoids having to call the cpu notifier directly for cpu 0. 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 Reviewed-by: Dario Faggioli --- 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 f90e496eda..caea5bd8b3 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -762,18 +762,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