History

smp: Remove allocation mask from on_each_cpu_cond.*()

The allocation mask is no longer used by on_each_cpu_cond() and on_each_cpu_cond_mask() and can be removed.

Sebastian Andrzej Siewior committed 6 years ago

Commit cb923151 parent 67719ef6 files · +11 −20Browse files

Unified · Split

6 files
  1. arch/x86/mm/tlb.c +1 −1
  2. fs/buffer.c +1 −1
  3. include/linux/smp.h +2 −3
  4. kernel/smp.c +3 −10
  5. kernel/up.c +3 −4
  6. mm/slub.c +1 −1
arch/x86/mm/tlb.c+1−1
@@ -708,7 +708,7 @@ void native_flush_tlb_others(const struct cpumask *cpumask, · 707 unmodified lines
708 (void *)info, 1);708 (void *)info, 1);
709 else709 else
710 on_each_cpu_cond_mask(tlb_is_not_lazy, flush_tlb_func_remote,710 on_each_cpu_cond_mask(tlb_is_not_lazy, flush_tlb_func_remote,
711 (void *)info, 1, GFP_ATOMIC, cpumask);711 (void *)info, 1, cpumask);
712}712}
713 713
714/*714/*
fs/buffer.c+1−1
@@ -1433,7 +1433,7 @@ static bool has_bh_in_lru(int cpu, void *dummy) · 1432 unmodified lines
1433 1433
1434void invalidate_bh_lrus(void)1434void invalidate_bh_lrus(void)
1435{1435{
1436 on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1, GFP_KERNEL);1436 on_each_cpu_cond(has_bh_in_lru, invalidate_bh_lru, NULL, 1);
1437}1437}
1438EXPORT_SYMBOL_GPL(invalidate_bh_lrus);1438EXPORT_SYMBOL_GPL(invalidate_bh_lrus);
1439 1439
include/linux/smp.h+2−3
@@ -51,11 +51,10 @@ void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func, · 50 unmodified lines
51 * processor.51 * processor.
52 */52 */
53void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,53void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,
54 void *info, bool wait, gfp_t gfp_flags);54 void *info, bool wait);
55 55
56void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,56void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
57 void *info, bool wait, gfp_t gfp_flags,57 void *info, bool wait, const struct cpumask *mask);
58 const struct cpumask *mask);
59 58
60int smp_call_function_single_async(int cpu, call_single_data_t *csd);59int smp_call_function_single_async(int cpu, call_single_data_t *csd);
61 60
kernel/smp.c+3−10
@@ -679,11 +679,6 @@ EXPORT_SYMBOL(on_each_cpu_mask); · 678 unmodified lines
679 * @info: An arbitrary pointer to pass to both functions.679 * @info: An arbitrary pointer to pass to both functions.
680 * @wait: If true, wait (atomically) until function has680 * @wait: If true, wait (atomically) until function has
681 * completed on other CPUs.681 * completed on other CPUs.
682 * @gfp_flags: GFP flags to use when allocating the cpumask
683 * used internally by the function.
684 *
685 * The function might sleep if the GFP flags indicates a non
686 * atomic allocation is allowed.
687 *682 *
688 * Preemption is disabled to protect against CPUs going offline but not online.683 * Preemption is disabled to protect against CPUs going offline but not online.
689 * CPUs going online during the call will not be seen or sent an IPI.684 * CPUs going online during the call will not be seen or sent an IPI.
@@ -692,8 +687,7 @@ EXPORT_SYMBOL(on_each_cpu_mask); · 2 unmodified lines
692 * from a hardware interrupt handler or from a bottom half handler.687 * from a hardware interrupt handler or from a bottom half handler.
693 */688 */
694void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,689void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
695 void *info, bool wait, gfp_t gfp_flags,690 void *info, bool wait, const struct cpumask *mask)
696 const struct cpumask *mask)
697{691{
698 int cpu = get_cpu();692 int cpu = get_cpu();
699 693
@@ -710,10 +704,9 @@ void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, · 10 unmodified lines
710EXPORT_SYMBOL(on_each_cpu_cond_mask);704EXPORT_SYMBOL(on_each_cpu_cond_mask);
711 705
712void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,706void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,
713 void *info, bool wait, gfp_t gfp_flags)707 void *info, bool wait)
714{708{
715 on_each_cpu_cond_mask(cond_func, func, info, wait, gfp_flags,709 on_each_cpu_cond_mask(cond_func, func, info, wait, cpu_online_mask);
716 cpu_online_mask);
717}710}
718EXPORT_SYMBOL(on_each_cpu_cond);711EXPORT_SYMBOL(on_each_cpu_cond);
719 712
kernel/up.c+3−4
@@ -69,8 +69,7 @@ EXPORT_SYMBOL(on_each_cpu_mask); · 68 unmodified lines
69 * same condtions in UP and SMP.69 * same condtions in UP and SMP.
70 */70 */
71void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,71void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
72 void *info, bool wait, gfp_t gfp_flags,72 void *info, bool wait, const struct cpumask *mask)
73 const struct cpumask *mask)
74{73{
75 unsigned long flags;74 unsigned long flags;
76 75
@@ -85,9 +84,9 @@ void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func, · 8 unmodified lines
85EXPORT_SYMBOL(on_each_cpu_cond_mask);84EXPORT_SYMBOL(on_each_cpu_cond_mask);
86 85
87void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,86void on_each_cpu_cond(smp_cond_func_t cond_func, smp_call_func_t func,
88 void *info, bool wait, gfp_t gfp_flags)87 void *info, bool wait)
89{88{
90 on_each_cpu_cond_mask(cond_func, func, info, wait, gfp_flags, NULL);89 on_each_cpu_cond_mask(cond_func, func, info, wait, NULL);
91}90}
92EXPORT_SYMBOL(on_each_cpu_cond);91EXPORT_SYMBOL(on_each_cpu_cond);
93 92
mm/slub.c+1−1
@@ -2341,7 +2341,7 @@ static bool has_cpu_slab(int cpu, void *info) · 2340 unmodified lines
2341 2341
2342static void flush_all(struct kmem_cache *s)2342static void flush_all(struct kmem_cache *s)
2343{2343{
2344 on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1, GFP_ATOMIC);2344 on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
2345}2345}
2346 2346
2347/*2347/*