public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH bitmap-for-next 0/4] lib/cpumask, blk_mq: Fix blk_mq_hctx_next_cpu() vs cpumask_check()
@ 2022-10-06 12:21 Valentin Schneider
  2022-10-06 12:21 ` [RFC PATCH bitmap-for-next 1/4] lib/cpumask: Generate cpumask_next_wrap() body with a macro Valentin Schneider
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Valentin Schneider @ 2022-10-06 12:21 UTC (permalink / raw)
  To: linux-block, linux-kernel
  Cc: Jens Axboe, Yury Norov, Andy Shevchenko, Rasmus Villemoes

Hi,

I've split this from [1] given I don't have any updates to the other patches,
and this can live separately from them.

I figured I'd follow what Yury has done and condense the logic of
cpumask_next_wrap() into a macro, however cpumask_next_wrap() has a UP variant
which makes this a bit more annoying.

I've tried giving the UP variant its own macro in cpumask.c and declaring
it there, but that means making cpumask.c compile under !CONFIG_SMP (again),
which means doing the same for all of the cpumask.c functions that have UP
variants (cpumask_local_spread(), cpumask_any_*distribute()...).

Before going too deep in what might be a stupid idea, I thought I'd stop there,
send what I have, and check what folks if that sounds sane.

If it does, I see two ways of handling the UP stubs:
o Get rid of the UP optimizations and use the same code as SMP
o Move *all* definitions of the UP optimizations into cpumask.c with
  a different set of macros (e.g. a *_UP() variant).

[1]: http://lore.kernel.org/r/20221003153420.285896-1-vschneid@redhat.com
  
Cheers,
Valentin

Valentin Schneider (4):
  lib/cpumask: Generate cpumask_next_wrap() body with a macro
  lib/cpumask: Fix cpumask_check() warning in cpumask_next_wrap*()
  lib/cpumask: Introduce cpumask_next_and_wrap()
  blk_mq: Fix cpumask_check() warning in blk_mq_hctx_next_cpu()

 block/blk-mq.c          | 39 +++++++++------------------
 include/linux/cpumask.h | 22 +++++++++++++++
 lib/cpumask.c           | 60 ++++++++++++++++++++++++++++++-----------
 3 files changed, 79 insertions(+), 42 deletions(-)

--
2.31.1


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

end of thread, other threads:[~2022-10-07  5:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-06 12:21 [RFC PATCH bitmap-for-next 0/4] lib/cpumask, blk_mq: Fix blk_mq_hctx_next_cpu() vs cpumask_check() Valentin Schneider
2022-10-06 12:21 ` [RFC PATCH bitmap-for-next 1/4] lib/cpumask: Generate cpumask_next_wrap() body with a macro Valentin Schneider
2022-10-06 12:21 ` [RFC PATCH bitmap-for-next 2/4] lib/cpumask: Fix cpumask_check() warning in cpumask_next_wrap*() Valentin Schneider
2022-10-06 12:21 ` [RFC PATCH bitmap-for-next 3/4] lib/cpumask: Introduce cpumask_next_and_wrap() Valentin Schneider
2022-10-06 12:21 ` [RFC PATCH bitmap-for-next 4/4] blk_mq: Fix cpumask_check() warning in blk_mq_hctx_next_cpu() Valentin Schneider
2022-10-06 13:50   ` Yury Norov
2022-10-06 15:17     ` Valentin Schneider
2022-10-07  5:15       ` Yury Norov

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