[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110223191043.GU2163@linux.vnet.ibm.com>
Date: Wed, 23 Feb 2011 11:10:43 -0800
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Christoph Lameter <cl@...ux.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
dipankar@...ibm.com, akpm@...ux-foundation.org,
josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, Valdis.Kletnieks@...edu, dhowells@...hat.com,
eric.dumazet@...il.com, darren@...art.com,
"Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH RFC tip/core/rcu 11/11] rcu: move TREE_RCU from softirq
to kthread
On Wed, Feb 23, 2011 at 11:34:32AM -0600, Christoph Lameter wrote:
> On Wed, 23 Feb 2011, Mathieu Desnoyers wrote:
>
> > > > > +
> > > > > + local_irq_save(flags);
> > > > > + cpu = smp_processor_id();
>
> Drop this line.
>
> > > > > + if (per_cpu(rcu_cpu_kthread_task, cpu) == NULL) {
>
> use this_cpu_read(rcu_cpu_kthread_task)
>
> > > > > + local_irq_restore(flags);
> > > > > + return;
> > > > > + }
> > > > > + per_cpu(rcu_cpu_has_work, cpu) = 1;
>
> this_cpu_write(rcu_cpu_has_work, 1);
I have made these changes, thank you!
These do introduce redundant preempt_disable()/preempt_enable() calls, but
this is not on a fastpath, so should be OK, and the improved readability
is certainly nice. The read and the write do need to happen on the same
CPU, FWIW.
> > This is not quite true on x86_64 and s390 anymore. __get_cpu_var() now
> > uses a segment selector override to get the local CPU variable on x86.
> > See x86's percpu.h for details.
>
> __get_cpu_var cannot use a segment override since there are places where
> the address of the variable is taken. One needs to use this_cpu_ops for
> that.
Thanks for the info!
Thanx, Paul
> > > True, but we could also argue that the multiple checks for being preempt
> > > can also be an issue.
> >
> > At least on x86 preemption don't actually need to be disabled: selection
> > of the right per-cpu memory location is done atomically with the rest of
> > the instruction by the segment selector.
>
> Right.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists