Re: [PATCH v2 2/5] cpumask: Introduce for_each_cpu_andnot()

From: Yury Norov
Date: Thu Aug 18 2022 - 18:40:18 EST


On Wed, Aug 17, 2022 at 06:58:09PM +0100, Valentin Schneider wrote:
> for_each_cpu_and() is very convenient as it saves having to allocate a
> temporary cpumask to store the result of cpumask_and(). The same issue
> applies to cpumask_andnot() which doesn't actually need temporary storage
> for iteration purposes.
>
> Following what has been done for for_each_cpu_and(), introduce
> for_each_cpu_andnot().
>
> Signed-off-by: Valentin Schneider <vschneid@xxxxxxxxxx>

I'm concerned that this series doesn't give us real examples and tests
for the new API. If we take it as-is, we'll end up with a dead code for
a while, quite probably for long.

Can you please submit a new code with a real application for the new API?
Alternatively, you can rework some existing code.

Briefly grepping, I found good candidate in a core code: __sched_core_flip(),
and one candidate in arch code: arch/powerpc/kernel/smp.c: update_coregroup_mask.
I believe there are much more.

Regarding the test, I don't think it's strictly necessary to have it as soon as
we'll have real users, but it's always good to backup with tests.

Thanks,
Yury