Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302763
b: refs/heads/master
c: dc87917
h: refs/heads/master
i:
  302761: 9af053e
  302759: 9716383
v: v3
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed Apr 30, 2012
1 parent e803dac commit e04479c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: 966f58c2f6df826f385706673a9bb1edcfd3499a
refs/heads/master: dc87917501e324701dbfb249def44054b5220187
9 changes: 8 additions & 1 deletion trunk/kernel/srcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ static bool srcu_readers_active_idx_check(struct srcu_struct *sp, int idx)
*/
static int srcu_readers_active(struct srcu_struct *sp)
{
return srcu_readers_active_idx(sp, 0) + srcu_readers_active_idx(sp, 1);
int cpu;
unsigned long sum = 0;

for_each_possible_cpu(cpu) {
sum += ACCESS_ONCE(per_cpu_ptr(sp->per_cpu_ref, cpu)->c[0]);
sum += ACCESS_ONCE(per_cpu_ptr(sp->per_cpu_ref, cpu)->c[1]);
}
return sum;
}

/**
Expand Down

0 comments on commit e04479c

Please sign in to comment.