Re: [PATCH resend] smp: avoid sending needless IPI in smp_call_function_many()

From: Peter Zijlstra
Date: Fri May 19 2017 - 07:10:04 EST


On Fri, May 19, 2017 at 03:53:31PM +0800, Aaron Lu wrote:
> @@ -434,6 +442,7 @@ void smp_call_function_many(const struct cpumask *mask,
> if (unlikely(!cpumask_weight(cfd->cpumask)))
> return;

Another thing that occurred to me while staring at that function, is
that we could move:

cpumask_and(cfd->cpumask, mask, cpu_online_mask);

to the very begin of that function, that would then obviate the need for
that cpumask_weight() test afaict.


I'm not sure its worth the trouble, but it would make the function
slightly easier to look at.