From: Sebastian Andrzej Siewior Date: Thu, 16 Jan 2020 13:13:41 +0100 Subject: [PATCH] smp: Remove allocation mask from on_each_cpu_cond.*() Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.13-rt7.tar.xz The allocation mask is no longer used by on_each_cpu_cond() and on_each_cpu_cond_mask() and ca be removed. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/mm/tlb.c | 2 +- fs/buffer.c | 2 +- include/linux/smp.h | 5 ++--- kernel/smp.c | 13 +++---------- kernel/up.c | 7 +++---- mm/slub.c | 2 +- 6 files changed, 11 insertions(+), 20 deletions(-) --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -708,7 +708,7 @@ void native_flush_tlb_others(const struc (void *)info, 1); else on_each_cpu_cond_mask(tlb_is_not_lazy, flush_tlb_func_remote, - (void *)info, 1, GFP_ATOMIC, cpumask); + (void *)info, 1, cpumask); } /* --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1387,7 +1387,7 @@ static bool has_bh_in_lru(int cpu, void void invalidate_bh_lrus(void) { - on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1, GFP_KERNEL); + on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1); } EXPORT_SYMBOL_GPL(invalidate_bh_lrus); --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -51,11 +51,10 @@ void on_each_cpu_mask(const struct cpuma * processor. */ void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags); + void *info, bool wait); void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags, - const struct cpumask *mask); + void *info, bool wait, const struct cpumask *mask); int smp_call_function_single_async(int cpu, call_single_data_t *csd); --- a/kernel/smp.c +++ b/kernel/smp.c @@ -679,11 +679,6 @@ EXPORT_SYMBOL(on_each_cpu_mask); * @info: An arbitrary pointer to pass to both functions. * @wait: If true, wait (atomically) until function has * completed on other CPUs. - * @gfp_flags: GFP flags to use when allocating the cpumask - * used internally by the function. - * - * The function might sleep if the GFP flags indicates a non - * atomic allocation is allowed. * * Preemption is disabled to protect against CPUs going offline but not online. * CPUs going online during the call will not be seen or sent an IPI. @@ -692,8 +687,7 @@ EXPORT_SYMBOL(on_each_cpu_mask); * from a hardware interrupt handler or from a bottom half handler. */ void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags, - const struct cpumask *mask) + void *info, bool wait, const struct cpumask *mask) { int cpu = get_cpu(); @@ -710,10 +704,9 @@ void on_each_cpu_cond_mask(smp_cond_func EXPORT_SYMBOL(on_each_cpu_cond_mask); void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags) + void *info, bool wait) { - on_each_cpu_cond_mask(cond_func, func, info, wait, gfp_flags, - cpu_online_mask); + on_each_cpu_cond_mask(cond_func, func, info, wait, cpu_online_mask); } EXPORT_SYMBOL(on_each_cpu_cond); --- a/kernel/up.c +++ b/kernel/up.c @@ -69,8 +69,7 @@ EXPORT_SYMBOL(on_each_cpu_mask); * same condtions in UP and SMP. */ void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags, - const struct cpumask *mask) + void *info, bool wait, const struct cpumask *mask) { unsigned long flags; @@ -85,9 +84,9 @@ void on_each_cpu_cond_mask(smp_cond_func EXPORT_SYMBOL(on_each_cpu_cond_mask); void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func, - void *info, bool wait, gfp_t gfp_flags) + void *info, bool wait) { - on_each_cpu_cond_mask(cond_func, func, info, wait, gfp_flags, NULL); + on_each_cpu_cond_mask(cond_func, func, info, wait, NULL); } EXPORT_SYMBOL(on_each_cpu_cond); --- a/mm/slub.c +++ b/mm/slub.c @@ -2340,7 +2340,7 @@ static bool has_cpu_slab(int cpu, void * static void flush_all(struct kmem_cache *s) { - on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1, GFP_ATOMIC); + on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1); } /*