Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377069
b: refs/heads/master
c: 016a8d5
h: refs/heads/master
i:
  377067: 94b73b9
v: v3
  • Loading branch information
Steven Rostedt authored and Paul E. McKenney committed Jun 10, 2013
1 parent 6da0bee commit bcb3816
Show file tree
Hide file tree
Showing 4 changed files with 19 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: d62840995a99c9766803d54e9d7923f247a1c1db
refs/heads/master: 016a8d5be6ddcc72ef0432d82d9f6fa34f61b907
1 change: 1 addition & 0 deletions trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ choice
config TREE_RCU
bool "Tree-based hierarchical RCU"
depends on !PREEMPT && SMP
select IRQ_WORK
help
This option selects the RCU implementation that is
designed for very large SMP system with hundreds or
Expand Down
17 changes: 15 additions & 2 deletions trunk/kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,14 @@ static int __noreturn rcu_gp_kthread(void *arg)
}
}

static void rsp_wakeup(struct irq_work *work)
{
struct rcu_state *rsp = container_of(work, struct rcu_state, wakeup_work);

/* Wake up rcu_gp_kthread() to start the grace period. */
wake_up(&rsp->gp_wq);
}

/*
* Start a new RCU grace period if warranted, re-initializing the hierarchy
* in preparation for detecting the next grace period. The caller must hold
Expand All @@ -1637,8 +1645,12 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp,
}
rsp->gp_flags = RCU_GP_FLAG_INIT;

/* Wake up rcu_gp_kthread() to start the grace period. */
wake_up(&rsp->gp_wq);
/*
* We can't do wakeups while holding the rnp->lock, as that
* could cause possible deadlocks with the rq->lock. Deter
* the wakeup to interrupt context.
*/
irq_work_queue(&rsp->wakeup_work);
}

/*
Expand Down Expand Up @@ -3235,6 +3247,7 @@ static void __init rcu_init_one(struct rcu_state *rsp,

rsp->rda = rda;
init_waitqueue_head(&rsp->gp_wq);
init_irq_work(&rsp->wakeup_work, rsp_wakeup);
rnp = rsp->level[rcu_num_lvls - 1];
for_each_possible_cpu(i) {
while (i > rnp->grphi)
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/rcutree.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/threads.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
#include <linux/irq_work.h>

/*
* Define shape of hierarchy based on NR_CPUS, CONFIG_RCU_FANOUT, and
Expand Down Expand Up @@ -442,6 +443,7 @@ struct rcu_state {
char *name; /* Name of structure. */
char abbr; /* Abbreviated name. */
struct list_head flavors; /* List of RCU flavors. */
struct irq_work wakeup_work; /* Postponed wakeups */
};

/* Values for rcu_state structure's gp_flags field. */
Expand Down

0 comments on commit bcb3816

Please sign in to comment.