lkml.org 
[lkml]   [2012]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tip/core/rcu 12/23] rcu: Prevent force_quiescent_state() memory contention
On Thu, Aug 30, 2012 at 11:18:27AM -0700, Paul E. McKenney wrote:
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
[...]
> @@ -1824,16 +1825,35 @@ static void force_qs_rnp(struct rcu_state *rsp, int (*f)(struct rcu_data *))
> static void force_quiescent_state(struct rcu_state *rsp)
> {
> unsigned long flags;
> - struct rcu_node *rnp = rcu_get_root(rsp);
> + bool ret;
> + struct rcu_node *rnp;
> + struct rcu_node *rnp_old = NULL;
> +
> + /* Funnel through hierarchy to reduce memory contention. */
> + rnp = per_cpu_ptr(rsp->rda, raw_smp_processor_id())->mynode;

What makes this use of raw_smp_processor_id() safe? (And, could you
document the answer here?)

> + for (; rnp != NULL; rnp = rnp->parent) {
> + ret = (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) ||
> + !raw_spin_trylock(&rnp->fqslock);

So, the root lock will still get trylocked by one CPU per second-level
tree node, just not by every CPU?

> @@ -2721,10 +2741,14 @@ static void __init rcu_init_levelspread(struct rcu_state *rsp)
> static void __init rcu_init_one(struct rcu_state *rsp,
> struct rcu_data __percpu *rda)
> {
> - static char *buf[] = { "rcu_node_level_0",
> - "rcu_node_level_1",
> - "rcu_node_level_2",
> - "rcu_node_level_3" }; /* Match MAX_RCU_LVLS */
> + static char *buf[] = { "rcu_node_0",
> + "rcu_node_1",
> + "rcu_node_2",
> + "rcu_node_3" }; /* Match MAX_RCU_LVLS */

Why rename these?

- Josh Triplett


\
 
 \ /
  Last update: 2012-09-02 13:21    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site