OSDN Git Service

smp: Add a smp_cond_func_t argument to smp_call_function_many()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 17 Jan 2020 09:01:36 +0000 (10:01 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 24 Jan 2020 19:40:09 +0000 (20:40 +0100)
commit67719ef25eeb2048b11befa6a757aeb3848b5df1
tree07a32cb57014b1ca8b1e5c21c4bfea2c1f2946d9
parent5671d814dbd204b4ecc705045b5f1a647bff6f3b
smp: Add a smp_cond_func_t argument to smp_call_function_many()

on_each_cpu_cond_mask() allocates a new CPU mask. The newly allocated
mask is a subset of the provided mask based on the conditional function.

This memory allocation can be avoided by extending smp_call_function_many()
with the conditional function and performing the remote function call based
on the mask and the conditional function.

Rename smp_call_function_many() to smp_call_function_many_cond() and add
the smp_cond_func_t argument. If smp_cond_func_t is provided then it is
used before invoking the function.  Provide smp_call_function_many() with
cond_func set to NULL.  Let on_each_cpu_cond_mask() use
smp_call_function_many_cond().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20200117090137.1205765-3-bigeasy@linutronix.de
kernel/smp.c