All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] cpumask: Fix invalid uniprocessor assumptions
@ 2022-06-05  6:22 Sander Vanheule
  2022-06-05  6:22 ` [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption Sander Vanheule
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Sander Vanheule @ 2022-06-05  6:22 UTC (permalink / raw)
  To: Peter Zijlstra, Yury Norov, Andrew Morton, Valentin Schneider,
	Thomas Gleixner, Greg Kroah-Hartman, Marco Elver
  Cc: linux-kernel, Andy Shevchenko, Sander Vanheule

On uniprocessor builds, it is currently assumed that any cpumask will
contain the single CPU: cpu0. This assumption is used to provide
optimised implementations.

The current assumption also appears to be wrong, by ignoring the fact
that users can provide empty cpumask-s. This can result in bugs as
explained in [1].

This series introduces some basic tests, and updates the optimisations
for uniprocessor builds.

[1] https://lore.kernel.org/all/20220530082552.46113-1-sander@svanheule.net/

Changes since v2:
Link: https://lore.kernel.org/all/cover.1654362935.git.sander@svanheule.net/
  - Put new tests after patch fixes
  - Update for_each_* macros

Changes since v1:
Link: https://lore.kernel.org/all/cover.1654201862.git.sander@svanheule.net/
  - Place tests in lib/test_cpumask.c
  - Drop the modified UP code in favor of the generic SMP implementation
  - Update declaration of cpumask_next_wrap()

Sander Vanheule (4):
  cpumask: Fix invalid uniprocessor mask assumption
  lib/test: Introduce cpumask KUnit test suite
  cpumask: Add UP optimised for_each_*_cpu versions
  cpumask: Update cpumask_next_wrap() signature

 include/linux/cpumask.h |  89 +++------------------------
 lib/Kconfig.debug       |   9 +++
 lib/Makefile            |   4 +-
 lib/test_cpumask.c      | 132 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 151 insertions(+), 83 deletions(-)
 create mode 100644 lib/test_cpumask.c

-- 
2.36.1


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

end of thread, other threads:[~2022-06-08 17:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-05  6:22 [PATCH v3 0/4] cpumask: Fix invalid uniprocessor assumptions Sander Vanheule
2022-06-05  6:22 ` [PATCH v3 1/4] cpumask: Fix invalid uniprocessor mask assumption Sander Vanheule
2022-06-06  0:48   ` kernel test robot
2022-06-06 10:40     ` Andy Shevchenko
2022-06-08 17:59       ` Sander Vanheule
2022-06-08 17:59         ` Sander Vanheule
2022-06-06 19:14   ` Yury Norov
2022-06-07 12:06     ` Sander Vanheule
2022-06-05  6:22 ` [PATCH v3 2/4] lib/test: Introduce cpumask KUnit test suite Sander Vanheule
2022-06-05  6:31   ` Sander Vanheule
2022-06-06 10:36   ` Andy Shevchenko
2022-06-06 12:22     ` Sander Vanheule
2022-06-05  6:22 ` [PATCH v3 3/4] cpumask: Add UP optimised for_each_*_cpu versions Sander Vanheule
2022-06-05  6:22 ` [PATCH v3 4/4] cpumask: Update cpumask_next_wrap() signature Sander Vanheule
2022-06-06 10:37   ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.