From: Eric Dumazet Date: Fri, 20 Jan 2017 14:34:22 +0000 (-0800) Subject: percpu_counter: percpu_counter_hotcpu_callback() cleanup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aaf0f2fa682861e47a4f6a8762d2b8a9a4a51077;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git percpu_counter: percpu_counter_hotcpu_callback() cleanup In commit ebd8fef304f9 ("percpu_counter: make percpu_counters_lock irq-safe") we disabled irqs in percpu_counter_hotcpu_callback() We can grab every counter spinlock without having to disable irqs again. Signed-off-by: Eric Dumazet Cc: Tejun Heo Signed-off-by: Tejun Heo --- diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index c8cebb137076..9c21000df0b5 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -176,13 +176,12 @@ static int percpu_counter_cpu_dead(unsigned int cpu) spin_lock_irq(&percpu_counters_lock); list_for_each_entry(fbc, &percpu_counters, list) { s32 *pcount; - unsigned long flags; - raw_spin_lock_irqsave(&fbc->lock, flags); + raw_spin_lock(&fbc->lock); pcount = per_cpu_ptr(fbc->counters, cpu); fbc->count += *pcount; *pcount = 0; - raw_spin_unlock_irqrestore(&fbc->lock, flags); + raw_spin_unlock(&fbc->lock); } spin_unlock_irq(&percpu_counters_lock); #endif