[PATCH 0/4] lib/group_cpus: rework grp_spread_init_one() and make it O(1)

From: Yury Norov
Date: Wed Nov 01 2023 - 18:34:33 EST


grp_spread_init_one() implementation is sub-optimal now because it
traverses bitmaps from the beginning, instead of picking from the
previous iteration.

Fix it and use find_bit API where appropriate.

Yury Norov (4):
cpumask: introduce for_each_cpu_and_from()
lib/group_cpus: relax atomicity requirement in grp_spread_init_one()
lib/group_cpus: optimize inner loop in grp_spread_init_one()
lib/group_cpus: optimize outer loop in grp_spread_init_one()

include/linux/cpumask.h | 11 +++++++++++
include/linux/find.h | 3 +++
lib/group_cpus.c | 29 ++++++++++++-----------------
3 files changed, 26 insertions(+), 17 deletions(-)

--
2.39.2