Commit e33de428 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] Shorten rcu_check_quiescent_state.

Single spin_unlock path cuts this down a little..
parent 73ba856c
...@@ -121,9 +121,8 @@ static void rcu_check_quiescent_state(void) ...@@ -121,9 +121,8 @@ static void rcu_check_quiescent_state(void)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
if (!test_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask)) { if (!test_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask))
return; return;
}
/* /*
* Races with local timer interrupt - in the worst case * Races with local timer interrupt - in the worst case
...@@ -134,23 +133,22 @@ static void rcu_check_quiescent_state(void) ...@@ -134,23 +133,22 @@ static void rcu_check_quiescent_state(void)
RCU_last_qsctr(cpu) = RCU_qsctr(cpu); RCU_last_qsctr(cpu) = RCU_qsctr(cpu);
return; return;
} }
if (RCU_qsctr(cpu) == RCU_last_qsctr(cpu)) { if (RCU_qsctr(cpu) == RCU_last_qsctr(cpu))
return; return;
}
spin_lock(&rcu_ctrlblk.mutex); spin_lock(&rcu_ctrlblk.mutex);
if (!test_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask)) { if (!test_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask))
spin_unlock(&rcu_ctrlblk.mutex); goto out_unlock;
return;
}
clear_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask); clear_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask);
RCU_last_qsctr(cpu) = RCU_QSCTR_INVALID; RCU_last_qsctr(cpu) = RCU_QSCTR_INVALID;
if (rcu_ctrlblk.rcu_cpu_mask != 0) { if (rcu_ctrlblk.rcu_cpu_mask != 0)
spin_unlock(&rcu_ctrlblk.mutex); goto out_unlock;
return;
}
rcu_ctrlblk.curbatch++; rcu_ctrlblk.curbatch++;
rcu_start_batch(rcu_ctrlblk.maxbatch); rcu_start_batch(rcu_ctrlblk.maxbatch);
out_unlock:
spin_unlock(&rcu_ctrlblk.mutex); spin_unlock(&rcu_ctrlblk.mutex);
} }
......
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