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

RE: [PATCH v2] xen/arm: Fix sibling mask setup to only include online CPUs


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Thu, 26 Nov 2026 03:36:37 +0000
  • Accept-language: ja-JP, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=m+1xcuCRwFcMlPPQ0dWTURU4ZCHNXljmPkQB4An9Hh4=; b=oewozgE5vmhNgm5jWn+Xa092HkVp8KAqKJKh98mfSE92cuQvAEknVlTrRwNBqW7XvHW1FayQ6MSXSTMODuC21ki3nlZognwE+5qoPxE65pGvxFqV/Wb+vtT6e6wpZlroynmL3JRbfzrK5rR+050hH9kqAi20TF3EUoWskmimcSMxYVYwINs/TVX1+teFEOj5DSnQkS46kPF8iL7B8yR8DrZSjF2c1oSTAk08mmgNL4OjExRkMuBy/6Pbbni0TigwaDOTzhFsd53A9wVtSutWy16a3kq0dzUOTZm5eUSCCFoAmRvv0au3Af2fNZ9m3YwT0byUxkS2WXzu67QbKY1K0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n3snVIeNFVyqnoslEbTPC+PiOsDqecOm8MkcDyZANMzj4XZRmn0CBXn9qWYRJEqCEOcyfApHMVs/NO91yVhz2TcdtlZbsl7uwFA3lfaXdfBwiJ7Z1N1YgmboIDgERULZKBJdCOzBi60AMpMVjRACMbIQbOyszoVc5F2fT9T0v/FuQIwzvRdnuAKKzFcOJwFVwB8rhgzUfqX9vF/VoGfi7Auhu2oW68CLa/UOhNxro5WKvRr/w8oCxBaLcyDibiLdsOnpglIsraP7s7lFODabkibHzkPukgfkZqc1Ilbjw09D3qa5Esr7X8F4o1/wdI0ZXedOKrHIpVZOLm/H0JdM+g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 26 Nov 2026 03:36:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdcA2DT3FSMPLxskS/PZRJxKJOO7c+oEeAgAEEahA=
  • Thread-topic: [PATCH v2] xen/arm: Fix sibling mask setup to only include online CPUs

Hi, Michal

> > Populate the CPU sibling map only with CPUs that are brought
> > online. Currently, all CPUs in cpu_possible_map are added,
> > which leaves CPUs that failed to boot in the sibling masks and
> > may lead the scheduler to make incorrect decisions.
> >
> > Changes in v2:
> This should be moved after '---'

I will fix it.
 
> > --- a/xen/arch/arm/smpboot.c
> > +++ b/xen/arch/arm/smpboot.c
> > @@ -91,15 +91,27 @@ static int setup_cpu_sibling_map(int cpu)
> >           !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
> >          return -ENOMEM;
> >
> > +    return 0;
> > +}
> > +
> > +static void set_cpu_sibling_map(int cpu)
> unsigned as on x86?

In x86 Xen, the cpu parameter type in the sibling mask helper functions is a 
mix of
'int' and 'unsigned int'. 
It seems 'unsigned int' will be better for ARM Xen.

x86 > static void remove_siblinginfo(int cpu)
x86 > static void set_cpu_sibling_map(unsigned int cpu)
x86 > static void cpu_smpboot_free(unsigned int cpu, bool remove)
 
> > +{
> > +    unsigned int sibling;
> > +
> > +    BUG_ON (!per_cpu(cpu_sibling_mask, cpu));
> there should be no space between BUG_ON and parenthesis

Okay.

> > +    BUG_ON (!per_cpu(cpu_core_mask, cpu));
> > +
> >      /*
> >       * Currently we assume there is no multithread and NUMA, so
> >       * a CPU is a sibling with itself, and the all possible CPUs
> your change switches to online, so a comment should be updated

Okay.

> >       * are supposed to belong to the same socket (NUMA node).
> >       */
> >      cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
> > -    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
> > +    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_online_map);
> > +    cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
> >
> > -    return 0;
> > +    for_each_online_cpu(sibling)
> > +        cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, sibling));
> With your change I think we should remove the cpu that is being removed from 
> its
> every sibling's cpu_core_mask on CPU_DEAD.

Okay, I will implement it.

Thank you,
Hirokazu Takahashi.

 


Rackspace

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