Commit 3bf97e49 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] RCU idle detection fix

Patch from Dipankar Sarma <dipankar@in.ibm.com>

There is a check in RCU for idle CPUs which signifies quiescent state
(and hence no reference to RCU protected data) which was broken when
interrupt counters were changed to use thread_info->preempt_count.

Martin's 32 CPU machine with many idle CPUs was not completing any RCU
grace period because RCU was forever waiting for idle CPUs to context
switch.  Had the idle check worked, this would not have happened.  With
no RCU happening, the dentries were getting "freed" (dentry stats
showing that) but not getting returned to slab.  This would not show up
in systems that are generally busy as context switches then would
happen in all CPUs and the per-CPU quiescent state counter would get
incremented during context switch.
parent b51c26f7
...@@ -192,7 +192,8 @@ static void rcu_process_callbacks(unsigned long unused) ...@@ -192,7 +192,8 @@ static void rcu_process_callbacks(unsigned long unused)
void rcu_check_callbacks(int cpu, int user) void rcu_check_callbacks(int cpu, int user)
{ {
if (user || if (user ||
(idle_cpu(cpu) && !in_softirq() && hardirq_count() <= 1)) (idle_cpu(cpu) && !in_softirq() &&
hardirq_count() <= (1 << HARDIRQ_SHIFT)))
RCU_qsctr(cpu)++; RCU_qsctr(cpu)++;
tasklet_schedule(&RCU_tasklet(cpu)); tasklet_schedule(&RCU_tasklet(cpu));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment