Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp269000ybb; Thu, 28 Mar 2019 02:04:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCOoxpZeslvsDnSIChXh+jatGag0mPLi2VD/xH4bkKwbexd+vqwzk7bHXwecPy5aazWpD7 X-Received: by 2002:a17:902:380c:: with SMTP id l12mr42002702plc.238.1553763873603; Thu, 28 Mar 2019 02:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553763873; cv=none; d=google.com; s=arc-20160816; b=L0gA2Wll4GH866K8rB8ddd96py+BJj8YCt9KGl/tq9QK/b+nrUyCVkEHR2tFKUoszd kCtyq2/H+Ljqu/BX5j7j4wFkNO0mu9Cg5oMCxkDKjDFDtRGPY4dFxPq1/9zQvCEeGvod 8bXimRqnCwGokKK9ixi0ZoaEZHhs5cNg2utpvfirt2VJzecKsBWKaBiaST6kEeXSmXeq 8k0NNaRexJSX4AwVPHm95g01meIkE3FRz4C7VAuM92ATfjQM+YE/3M0Sz5azL4lDtL6g J8A5yJMMht3Av2QZR8fqacbgPwcynRxp1DcMSZOW64CAP+7uIEJrnFqZouPGR4IbZ+f6 nFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references :subject:cc:to:from:date:message-id; bh=ZO3mff/3IMQRs6tonYug6RRmxSrVQS6sSG/lZzC7Pw8=; b=SOMnLc1HuL30Dk2Nc8wCihDClT0FriImIknm2hmqBC1gOCluc+iE6yhjIIgcTd5Yzi w0Urpk0RqpXpfhtNRnrwbVYTS1Rksuu26NVgypQOVh2CLeUuQW+LXRvhijjygxliYIW/ sCia7hEvdJZH9W5QSZNizng20ucWX+8AmZS9A/5RvRZPUOayzTUrO5hAOB5jLp6fiGxF JlgqMsW0I+ESHKXs5Al6KCcy+2Uv0gXlfCuL2tow+gLODoHMeALGR+hrg25PQywKXCjd VOF9JLh0wu/DRHso/zIaVdHibZN4rDG/nSZXNWN38g+DzMoYiqrqE6BXdC+Gm0rGpcsv EiEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si20056917pgv.39.2019.03.28.02.04.16; Thu, 28 Mar 2019 02:04:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbfC1JD0 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 28 Mar 2019 05:03:26 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:39311 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbfC1JD0 (ORCPT ); Thu, 28 Mar 2019 05:03:26 -0400 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Thu, 28 Mar 2019 03:03:25 -0600 Message-Id: <5C9C8DDC0200007800222606@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.1.0 Date: Thu, 28 Mar 2019 03:03:24 -0600 From: "Jan Beulich" To: "Boris Ostrovsky" Cc: "Stefano Stabellini" , "xen-devel" , "Juergen Gross" , Subject: Re: [PATCH] x86/Xen: streamline (and fix) PV CPU enumeration References: <5C9B92EA020000780022227B@prv1-mh.provo.novell.com> <2f027b4b-dce2-3e90-dc1b-c824bc8eb355@oracle.com> In-Reply-To: <2f027b4b-dce2-3e90-dc1b-c824bc8eb355@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 27.03.19 at 18:07, wrote: > On 3/27/19 11:12 AM, Jan Beulich wrote: >> - >> -static void __init xen_filter_cpu_maps(void) >> +static void __init _get_smp_config(unsigned int early) >> { >> int i, rc; >> unsigned int subtract = 0; >> >> - if (!xen_initial_domain()) >> + if (early) >> return; >> >> num_processors = 0; > > > Is there a reason to set_cpu_possible() here (not in the diff, but in > this routine)? This will be called from setup_arch() before > prefill_possible_map(), which will clear and then re-initialize > __cpu_possible_mask. I don't think it's needed before my change either, so I'd call removing this an orthogonal change. As said in the commit message, the goal was to leave this function alone as far as possible. Before my patch, xen_filter_cpu_maps() gets called long after prefill_possible_map(), and by the purpose of the latter function the possible map shouldn't be altered anymore once that has run. Adding bits to it is surely not going to have the intended effect (setup_per_cpu_areas() has already run), while removing bits may have some effect, but comes too late at least for setup_per_cpu_areas(). And if we were to remove this, I think the CONFIG_HOTPLUG_CPU section should go away as well. After all prefill_possible_map() also sets nr_cpu_ids. To be honest, it was largely this code fragment which made me want not touch the function more than necessary: The comment there makes not clear to me at all why all of this needs to be in an #ifdef in the first place. Let me know whether you really want me to fold this extra cleanup into this patch. If so, I'd then wonder whether the set_cpu_present() from xen_pv_smp_prepare_cpus() shouldn't be moved here, too. And the fiddling with the possible map there looks bogus as well: Bring-up of CPUs past the command line option should be avoided at boot time, but they shouldn't be excluded from getting brought up later on. Note how native_smp_prepare_cpus() ignores its parameter altogether. Jan