Re: [PATCH] rcu: simplify the usage of percpu data
From: Paul E. McKenney
Date: Mon Jun 28 2010 - 15:57:58 EST
On Mon, Jun 28, 2010 at 09:56:54AM -0700, Paul E. McKenney wrote:
> On Mon, Jun 28, 2010 at 10:38:39AM +0200, Tejun Heo wrote:
> > On 06/28/2010 10:25 AM, Lai Jiangshan wrote:
> > > &percpu_data is compatible with allocated percpu data.
> > >
> > > And we use it and remove the "rda[NR_CPUS]" array.
> > >
> > > Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> >
> > Looks good to me.
> >
> > Reviewed-by: Tejun Heo <tj@xxxxxxxxxx>
>
> Thank you both!!! I have queued this.
FYI, I added the patchlet below to make it build for CONFIG_RCU_TRACE
kernels.
Thanx, Paul
------------------------------------------------------------------------
rcu: apply ->rda changes to rcutree_trace.c
The print_rcu_pendings() function used the ->rda[] array, so this
commit makes it instead use per_cpu_ptr().
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 36c95b4..458e032 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -262,7 +262,7 @@ static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp)
struct rcu_data *rdp;
for_each_possible_cpu(cpu) {
- rdp = rsp->rda[cpu];
+ rdp = per_cpu_ptr(rsp->rda, cpu);
if (rdp->beenonline)
print_one_rcu_pending(m, rdp);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/