[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/smp: Factor out parts of native_smp_prepare_cpus()


  • To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Mon, 8 Nov 2021 12:20:26 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aOYwDHeoTwFBbLeM8Hc8dMyT2YDdAGdHFv2ithKVb7M=; b=GTVSfdaT3ntx8ASjjRvcKk3E0Wn1XfEGq9sVa4gFPfK/6M76SpLt2DcadnS2i0AbZSbm+lC1iRemc3VYreXLDZ8TGPuzdHBKSW2F0QblRUpAEM2nmEaFOuQho8/y73PWYO6rnzljKevutnFBErbLzSqGE9X4bNv1KjMPavbeX8Fxpohf0B3lPn0t/q0ziPAguDmneoqry02K//MdvJ0npYAQ7e5vNqo3vzJaqQxpSw/VDNejk7+rdw3SkyuKSNHHZYRZe/957ouzHv6A7Shj7RWIp+x9iA50Knf/tvZsz2Cxzc+MUu2KbT37yCiwdr3VTcj36yDM9i8WximWz4P2DQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kR22KvtoGZN6B0Ep/uKoGQrm10S767AkRuaPS5DmjCgxouA6RMI312Lj/xSih0zp0KFuIJRfXV4DVJisCxhPc6TZe++c4SSCeHZG+h1n1IEFzXeG9rgyEdRSrgpWeC+GdAYEBxw90+rWwyh8oGFcwcHyBivQRYvH3sTrRbNHTUOJKNsQChETVe+/xHETr5o0ArCobj3W3GZIhgEuYhofJ009hdVXQeLzv5DGIzCHHiu2Q3H4mluCwua/K1KjlzQkb6DrWi6hslrn7BWyOiD37Uv+Au2KXb4a4RjTdU1Dyt3pVrrHFpGyUU0MiAEq7jLakEHPM3gqIXwGEb6GpTsFAQ==
  • Authentication-results: infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=none action=none header.from=oracle.com;
  • Cc: linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, jgross@xxxxxxxx
  • Delivery-date: Mon, 08 Nov 2021 17:21:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 11/8/21 10:11 AM, Peter Zijlstra wrote:
On Tue, Nov 02, 2021 at 07:36:36PM -0400, Boris Ostrovsky wrote:
Commit 66558b730f25 ("sched: Add cluster scheduler level for x86")
introduced cpu_l2c_shared_map mask which is expected to be initialized
by smp_op.smp_prepare_cpus(). That commit only updated
native_smp_prepare_cpus() version but not xen_pv_smp_prepare_cpus().
As result Xen PV guests crash in set_cpu_sibling_map().

While the new mask can be allocated in xen_pv_smp_prepare_cpus() one can
see that both versions of smp_prepare_cpus ops share a number of common
operations that can be factored out. So do that instead.

Fixes: 66558b730f25 ("sched: Add cluster scheduler level for x86")
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Thanks! I'll go stick that somewhere /urgent (I've had another report on
that here:

   
https://lkml.kernel.org/r/20211105074139.GE174703@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
)


Thank you. (I don't see this message btw)



But looking at those functions; there seems to be more spurious
differences. For example, the whole sched_topology thing.


I did look at that and thought this should be benign given that Xen PV is not 
really topology-aware. I didn't see anything that would be a cause for concern 
but perhaps you can point me to things I missed.



Should we re-architect this whole smp_prepare_cpus() thing instead? Have
a common function and a guest function? HyperV for instance seems to
call native_smp_prepare_cpus() and then does something extra (as does
xen_hvm).


Something like


void smp_prepare_cpus()

{

    // Code that this patch moved to smp_prepare_cpus_common();


   smp_ops.smp_prepare_cpus();  // Including baremetal

}


?


XenHVM and hyperV will need to call native smp_op too. Not sure this will be 
prettier than what it is now?



-boris


-boris




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.