Skip to content

RFC lib/cpumask, blk_mq: Fix blk_mq_hctx_next_cpu() vs cpumask_check()

Valentin Schneider linux-block lkml oe-lkp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib/cpumask: Generate cpumask_next_wrap() body with a macrolib/cpumask.c+21 -160 replies
2/4lib/cpumask: Fix cpumask_check() warning in cpumask_next_wrap*()lib/cpumask.c+3 -30 replies
3/4lib/cpumask: Introduce cpumask_next_and_wrap()include/linux/cpumask.h lib/cpumask.c+45 -00 replies
4/4blk_mq: Fix cpumask_check() warning in blk_mq_hctx_next_cpu()block/blk-mq.c+13 -263 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH bitmap-for-next 0/4] lib/cpumask, blk_mq: Fix blk_mq_hctx_next_cpu() vs cpumask_check()

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/[email protected]

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