[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101110155419.GC5750@nowhere>
Date: Wed, 10 Nov 2010 16:54:28 +0100
From: Frederic Weisbecker <fweisbec@...il.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Joe Korty <joe.korty@...r.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
mathieu.desnoyers@...icios.com, dhowells@...hat.com,
loic.minier@...aro.org, dhaval.giani@...il.com, tglx@...utronix.de,
peterz@...radead.org, linux-kernel@...r.kernel.org,
josh@...htriplett.org, houston.jim@...cast.net
Subject: Re: [PATCH] a local-timer-free version of RCU
On Tue, Nov 09, 2010 at 05:22:49PM +0800, Lai Jiangshan wrote:
> It is hardly acceptable when there are memory barriers or
> atomic operations in the fast paths of rcu_read_lock(),
> rcu_read_unlock().
>
> We need some thing to drive the completion of GP
> (and the callbacks process). There is no free lunch,
> if the completion of GP is driven by rcu_read_unlock(),
> we very probably need memory barriers or atomic operations
> in the fast paths of rcu_read_lock(), rcu_read_unlock().
>
> We need look for some periodic/continuous events of
> the kernel for GP-driven, schedule-tick and schedule() are
> most ideal events sources in the kernel I think.
>
> schedule-tick and schedule() are not happened when NO_HZ
> and dyntick-hpc, so we need some approaches to fix it. I vote up
> for the #5 approach of Paul's.
>
> Also, I propose an unmature idea here.
>
> Don't tell RCU about dyntick-hpc mode, but instead
> stop the RCU function of a CPU when the first time RCU disturbs
> dyntick-hpc mode or NO_HZ mode.
>
> rcu_read_lock()
> if the RCU function of this CPU is not started, start it and
> start a RCU timer.
> handle rcu_read_lock()
>
> enter NO_HZ
> if interrupts are just happened very frequently, do nothing, else:
> stop the rcu function and the rcu timer of the current CPU.
>
> exit interrupt:
> if this interrupt is just caused by RCU timer && it just disrurbs
> dyntick-hpc mode or NO_HZ mode(and will reenter these modes),
> stop the rcu function and stop the rcu timer of the current CPU.
>
> schedule-tick:
> requeue the rcu timer before it causes an unneeded interrupt.
> handle rcu things.
>
> + Not big changes to RCU, use the same code to handle
> dyntick-hpc mode or NO_HZ mode, reuse some code of rcu_offline_cpu()
>
> + No need to inform RCU of user/kernel transitions.
>
> + No need to turn scheduling-clock interrupts on
> at each user/kernel transition.
>
> - carefully handle some critical region which also implies
> rcu critical region.
>
> - Introduce some unneeded interrupt, but it is very infrequency.
I like this idea.
I would just merge the concept of "rcu timer" into the sched tick,
as per Peter Zijlstra idea:
In this CPU isolation mode, we are going to do a kind of adapative
sched tick already: run the sched tick and if there was nothing to do
for some time and we are in userspace, deactivate it. If suddenly
a new task arrives on the CPU (which means there is now more than
one task running and we want preemption tick back), or if we have
timers enqueued, or so, reactivate it.
So I would simply merge your rcu idea into this, + the reactivation
on rcu_read_lock().
Someone see a bad thing in this idea?
--
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