Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191012
b: refs/heads/master
c: 77e38ed
h: refs/heads/master
v: v3
  • Loading branch information
Paul E. McKenney committed May 10, 2010
1 parent e0f1191 commit 68a3389
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d14aada8e20bdf81ffd43f433b123972cf575b32
refs/heads/master: 77e38ed347162423c6b72e06c865a121081c2bb6
12 changes: 10 additions & 2 deletions trunk/kernel/rcutree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,19 +1051,27 @@ static DEFINE_PER_CPU(unsigned long, rcu_dyntick_holdoff);
int rcu_needs_cpu(int cpu)
{
int c = 0;
int snap;
int snap_nmi;
int thatcpu;

/* Check for being in the holdoff period. */
if (per_cpu(rcu_dyntick_holdoff, cpu) == jiffies)
return rcu_needs_cpu_quick_check(cpu);

/* Don't bother unless we are the last non-dyntick-idle CPU. */
for_each_cpu_not(thatcpu, nohz_cpu_mask)
if (cpu_online(thatcpu) && thatcpu != cpu) {
for_each_online_cpu(thatcpu) {
if (thatcpu == cpu)
continue;
snap = per_cpu(rcu_dynticks, thatcpu)->dynticks;
snap_nmi = per_cpu(rcu_dynticks, thatcpu)->dynticks_nmi;
smp_mb(); /* Order sampling of snap with end of grace period. */
if (((snap & 0x1) != 0) || ((snap_nmi & 0x1) != 0)) {
per_cpu(rcu_dyntick_drain, cpu) = 0;
per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
return rcu_needs_cpu_quick_check(cpu);
}
}

/* Check and update the rcu_dyntick_drain sequencing. */
if (per_cpu(rcu_dyntick_drain, cpu) <= 0) {
Expand Down

0 comments on commit 68a3389

Please sign in to comment.