[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140806084708.GR9918@twins.programming.kicks-ass.net>
Date: Wed, 6 Aug 2014 10:47:08 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Oleg Nesterov <oleg@...hat.com>, linux-kernel@...r.kernel.org,
mingo@...nel.org, laijs@...fujitsu.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, tglx@...utronix.de, dhowells@...hat.com,
edumazet@...gle.com, dvhart@...ux.intel.com, fweisbec@...il.com,
bobby.prani@...il.com
Subject: Re: [PATCH v3 tip/core/rcu 3/9] rcu: Add synchronous grace-period
waiting for RCU-tasks
On Tue, Aug 05, 2014 at 06:21:39PM -0700, Paul E. McKenney wrote:
> > Yeah, idle threads can be affected by the trampolines. That is, we can
> > still hook a trampoline to some function in the idle loop.
> >
> > But we should be able to make the hardware call that puts the CPU to
> > sleep a quiescent state too. May need to be arch dependent. :-/
>
> OK, my plan for this eventuality is to do the following:
>
> 1. Ignore the ->on_rq field, as idle tasks are always on a runqueue.
>
> 2. Watch the context-switch counter.
>
> 3. Ignore dyntick-idle state for idle tasks.
>
> 4. If there is no quiescent state from a given idle task after
> a few seconds, schedule rcu_tasks_kthread() on top of the
> offending CPU.
>
> Your idea is an interesting one, but does require another set of
> dyntick-idle-like functions and counters. Or moving the current
> rcu_idle_enter() and rcu_idle_exit() calls deeper into the idle loop.
>
> Not sure which is a better approach. Alternatively, we could just
> rely on #4 above, on the grounds that battery life should not be
> too badly degraded by the occasional RCU-tasks interference.
>
> Note that this is a different situation than NO_HZ_FULL in realtime
> environments, where the worst case causes trouble even if it happens
> very infrequently.
Or you could shoot all CPUs with resched_cpu() which would have them
cycle through schedule() even if there's nothing but the idle thread to
run. That guarantees they'll go to sleep again in a !trampoline.
But I still very much hate the polling stuff...
Can't we abuse the preempt notifiers? Say we make it possible to install
preemption notifiers cross-task, then the task-rcu can install a
preempt-out notifier which completes the rcu-task wait.
After all, since we tagged it it was !running, and being scheduled out
means it ran (once) and therefore isn't on a trampoline anymore.
And the tick, which checks to see if the task got to userspace can do
the same, remove the notifier and then complete.
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists