Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143404
b: refs/heads/master
c: 5b1d07e
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 15, 2009
1 parent 3f01577 commit c8cf047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 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: da60682c116855cf342926b4f3427079400ee7e6
refs/heads/master: 5b1d07ed0e5b2707f786957c7a40eb2f399c84a8
18 changes: 8 additions & 10 deletions trunk/kernel/rcupdate.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ static DEFINE_MUTEX(rcu_barrier_mutex);
static struct completion rcu_barrier_completion;
int rcu_scheduler_active __read_mostly;

static atomic_t rcu_migrate_type_count = ATOMIC_INIT(0);
static struct rcu_head rcu_migrate_head[3];
static DECLARE_WAIT_QUEUE_HEAD(rcu_migrate_wq);

/*
* Awaken the corresponding synchronize_rcu() instance now that a
* grace period has elapsed.
Expand Down Expand Up @@ -122,7 +126,10 @@ static void rcu_barrier_func(void *type)
}
}

static inline void wait_migrated_callbacks(void);
static inline void wait_migrated_callbacks(void)
{
wait_event(rcu_migrate_wq, !atomic_read(&rcu_migrate_type_count));
}

/*
* Orchestrate the specified type of RCU barrier, waiting for all
Expand Down Expand Up @@ -179,21 +186,12 @@ void rcu_barrier_sched(void)
}
EXPORT_SYMBOL_GPL(rcu_barrier_sched);

static atomic_t rcu_migrate_type_count = ATOMIC_INIT(0);
static struct rcu_head rcu_migrate_head[3];
static DECLARE_WAIT_QUEUE_HEAD(rcu_migrate_wq);

static void rcu_migrate_callback(struct rcu_head *notused)
{
if (atomic_dec_and_test(&rcu_migrate_type_count))
wake_up(&rcu_migrate_wq);
}

static inline void wait_migrated_callbacks(void)
{
wait_event(rcu_migrate_wq, !atomic_read(&rcu_migrate_type_count));
}

static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
unsigned long action, void *hcpu)
{
Expand Down

0 comments on commit c8cf047

Please sign in to comment.