linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] cpumask: cleanup nr_cpu_ids vs nr_cpumask_bits mess
@ 2022-09-05 23:08 Yury Norov
  2022-09-05 23:08 ` [PATCH v2 1/5] smp: don't declare nr_cpu_ids if NR_CPUS == 1 Yury Norov
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Yury Norov @ 2022-09-05 23:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yury Norov, Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Stephen Rothwell, Peter Zijlstra, Thomas Gleixner,
	Paul E . McKenney, Vlastimil Babka, Dmitry Vyukov,
	Valentin Schneider, Sander Vanheule, Alexey Klimov, Eric Biggers

cpumask subsystem uses nr_cpu_ids and nr_cpumask_bits interchangeably
despite that the variables have different meaning and purpose. It makes
some cpumask functions broken.

This series cleans that mess and adds new config FORCE_NR_CPUS that
allows to optimize cpumask subsystem if the number of CPUs is known
at compile-time.

After some testing I found build broken when SMP is on and NR_CPUS == 1.
This is addressed in a new patch #1, and in the following patch #2 that
now declares set_nr_cpu_ids in cpumask.h (was in smp.h).

v1: https://lore.kernel.org/lkml/20220829165748.1008477-1-yury.norov@gmail.com/T/#mecbd787f8d1bff1454a4ec2fe46ad6dc168df695
v2:
 - don't declare nr_cpu_ids if NR_CPUS == 1;
 - move set_nr_cpu_ids() from smp.h to cpumask.h to avoid errors in some
   inclusion paths;
 - drop 'default n' in FORCE_NR_CPUS option description;
 - rebase on top of v6.0-rc4.

Yury Norov (5):
  smp: don't declare nr_cpu_ids if NR_CPUS == 1
  smp: add set_nr_cpu_ids()
  lib/cpumask: delete misleading comment
  lib/cpumask: deprecate nr_cpumask_bits
  lib/cpumask: add FORCE_NR_CPUS config option

 arch/loongarch/kernel/setup.c |  2 +-
 arch/mips/kernel/setup.c      |  2 +-
 arch/x86/kernel/smpboot.c     |  4 ++--
 arch/x86/xen/smp_pv.c         |  2 +-
 include/linux/cpumask.h       | 22 +++++++++++-----------
 kernel/smp.c                  |  6 ++++--
 lib/Kconfig                   |  9 +++++++++
 7 files changed, 29 insertions(+), 18 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-10-19  6:59 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 23:08 [PATCH v2 0/5] cpumask: cleanup nr_cpu_ids vs nr_cpumask_bits mess Yury Norov
2022-09-05 23:08 ` [PATCH v2 1/5] smp: don't declare nr_cpu_ids if NR_CPUS == 1 Yury Norov
2022-09-06  8:53   ` Peter Zijlstra
2022-09-06 14:06     ` Yury Norov
2022-09-06 14:36       ` Peter Zijlstra
2022-09-06 15:01         ` Andy Shevchenko
2022-09-06 17:53           ` Peter Zijlstra
2022-09-06 15:07         ` Yury Norov
2022-09-07  8:02         ` David Laight
2022-09-05 23:08 ` [PATCH v2 2/5] smp: add set_nr_cpu_ids() Yury Norov
2022-09-05 23:08 ` [PATCH v2 3/5] lib/cpumask: delete misleading comment Yury Norov
2022-09-05 23:08 ` [PATCH v2 4/5] lib/cpumask: deprecate nr_cpumask_bits Yury Norov
2022-09-05 23:08 ` [PATCH v2 5/5] lib/cpumask: add FORCE_NR_CPUS config option Yury Norov
2022-10-18  8:21   ` Geert Uytterhoeven
2022-10-18 13:15     ` Geert Uytterhoeven
2022-10-18 13:41       ` Andreas Schwab
2022-10-18 13:50         ` Geert Uytterhoeven
2022-10-18 14:35           ` Yury Norov
2022-10-18 14:44             ` Andy Shevchenko
2022-10-18 14:59               ` Yury Norov
2022-10-18 15:15                 ` Geert Uytterhoeven
2022-10-18 16:16                   ` Yury Norov
2022-10-19  6:58                     ` Geert Uytterhoeven
2022-09-06  8:55 ` [PATCH v2 0/5] cpumask: cleanup nr_cpu_ids vs nr_cpumask_bits mess Peter Zijlstra
2022-09-06 12:06   ` Valentin Schneider
2022-09-06 14:38     ` Peter Zijlstra
2022-09-06 15:45       ` Valentin Schneider
2022-09-06 16:26         ` Yury Norov
2022-09-06 14:48     ` Yury Norov
2022-09-06 14:35   ` Yury Norov
2022-09-15 14:45 ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).