mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] cpumask: add missing API and simplify cpumask_any_housekeeping()
@ 2025-04-27 18:52 Yury Norov
  2025-04-27 18:52 ` [PATCH v2 1/4] cpumask: relax cpumask_any_but() Yury Norov
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Yury Norov @ 2025-04-27 18:52 UTC (permalink / raw)
  To: Reinette Chatre, James Morse
  Cc: Yury Norov [NVIDIA],
	Tony Luck, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin, Rasmus Villemoes, x86, linux-kernel

From: Yury Norov [NVIDIA] <yury.norov@gmail.com>

cpumask library missed some flavors of cpumask_any_but(), which makes
users to workaround it by using less efficient cpumask_nth() functions

This series adds missing cpumask_any_andnot_but() and makes
cpumask_any_but() understanding the RESCTRL_PICK_ANY_CPU hint.
This simplifies cpumask_any_housekeeping() significantly.

v1: https://lore.kernel.org/all/20250407153856.133093-1-yury.norov@gmail.com/
v2:
 - switch cpumask_any_but() functions to signed type for CPU (Reinette);
 - change name for the new function to cpumask_any_andnot_but() (James);
 - drop O(n*log(n)) comment. cpumask_nth() is slower, but still linear.

Yury Norov [NVIDIA] (4):
  cpumask: relax cpumask_any_but()
  find: add find_first_andnot_bit()
  cpumask: add cpumask_{first,next}_andnot() API
  x86/resctrl: optimize cpumask_any_housekeeping()

 arch/x86/kernel/cpu/resctrl/internal.h | 28 +++-------
 include/linux/cpumask.h                | 75 ++++++++++++++++++++++++--
 include/linux/find.h                   | 25 +++++++++
 lib/find_bit.c                         | 11 ++++
 4 files changed, 114 insertions(+), 25 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-05-02 16:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-27 18:52 [PATCH v2 0/4] cpumask: add missing API and simplify cpumask_any_housekeeping() Yury Norov
2025-04-27 18:52 ` [PATCH v2 1/4] cpumask: relax cpumask_any_but() Yury Norov
2025-04-27 18:52 ` [PATCH v2 2/4] find: add find_first_andnot_bit() Yury Norov
2025-04-27 18:52 ` [PATCH v2 3/4] cpumask: add cpumask_{first,next}_andnot() API Yury Norov
2025-04-27 18:52 ` [PATCH v2 4/4] x86/resctrl: Optimize cpumask_any_housekeeping() Yury Norov
2025-05-01 22:06 ` [PATCH v2 0/4] cpumask: add missing API and simplify cpumask_any_housekeeping() Reinette Chatre
2025-05-02 15:32   ` Yury Norov
2025-05-02 16:17     ` Reinette Chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®