From: josh@joshtriplett.org
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com,
fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com
Subject: Re: [PATCH v2 tip/core/rcu 0/10] RCU-tasks implementation
Date: Thu, 31 Jul 2014 10:20:24 -0700 [thread overview]
Message-ID: <20140731172024.GF12697@cloud> (raw)
In-Reply-To: <20140731165843.GV11241@linux.vnet.ibm.com>
On Thu, Jul 31, 2014 at 09:58:43AM -0700, Paul E. McKenney wrote:
> On Thu, Jul 31, 2014 at 09:19:02AM -0700, josh@joshtriplett.org wrote:
> > On Wed, Jul 30, 2014 at 05:39:14PM -0700, Paul E. McKenney wrote:
> > > This series provides a prototype of an RCU-tasks implementation, which has
> > > been requested to assist with tramopoline removal. This flavor of RCU
> > > is task-based rather than CPU-based, and has voluntary context switch,
> > > usermode execution, and the idle loops as its only quiescent states.
> > > This selection of quiescent states ensures that at the end of a grace
> > > period, there will no longer be any tasks depending on a trampoline that
> > > was removed before the beginning of that grace period. This works because
> > > such trampolines do not contain function calls, do not contain voluntary
> > > context switches, do not switch to usermode, and do not switch to idle.
> >
> > I'm concerned about the amount of system overhead this introduces.
> > Polling for holdout tasks seems quite excessive. If I understand the
> > intended use case correctly, the users of this will want to free
> > relatively small amounts of memory; thus, waiting a while to do so seems
> > fine, especially if the system isn't under any particular memory
> > pressure.
> >
> > Thus, rather than polling, could you simply flag the holdout
> > tasks, telling the scheduler "hey, next time you don't have anything
> > better to do..."? Then don't bother with them again unless the system
> > runs low on memory and asks you to free some. (And mandate that you can
> > only use this to free memory rather than for any other purpose.)
>
> One of the many of my alternative suggestions that Steven rejected was
> to simply leak the memory. ;-)
>
> But from what I can see, if we simply flag the holdout tasks, we
> either are also holding onto the task_struct structures, re-introducing
> concurrency to the list of holdout tasks, or requiring that the eventual
> scan for holdout tasks scan the entire task list. Neither of these seems
> particularly appetizing to me.
>
> The nice thing about Lai Jiangshan's suggestion is that it allows the
> scan of the holdout list to be done completely unsynchronized, which
> allows pauses during the scan, thus allowing the loop to check for
> competing work on that CPU. This should get almost all the effect
> of indefinite delay without the indefinite delay (at least in the
> common case).
>
> Or am I missing something here?
If you only allow a single outstanding set of callbacks at a time, you
could have a single flag stored in the task, combined with a count
stored with the set of callbacks. Each time one of the holdout tasks
comes up, clear the flag and decrement the count. If and only if you
get asked to free up memory, start poking the scheduler to bring up
those tasks. When the count hits 0, free the memory.
The set of trampolines won't change often, and presumably only changes
in response to user-driven requests to trace or stop tracing things.
So, if you have to wait for the existing set of callbacks to go away
before adding more, that seems fine. And you could then ditch polling
entirely.
> > Also, ideally this should remain entirely optional; nothing in the core
> > kernel should depend on it.
>
> Agreed, the CONFIG_TASKS_RCU is not likely to disappear anytime soon.
> I therefore do not see RCU-tasks as an obstacle to kernel tinification.
> I also would also guess that you might complain if someone does try to
> use if from the tinified core of the Linux kernel. ;-)
Yes. :)
- Josh Triplett
next prev parent reply other threads:[~2014-07-31 17:20 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 0:39 [PATCH v2 tip/core/rcu 0/10] RCU-tasks implementation Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks() Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 02/10] rcu: Provide cond_resched_rcu_qs() to force quiescent states in long loops Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 03/10] rcu: Add synchronous grace-period waiting for RCU-tasks Paul E. McKenney
2014-07-31 16:58 ` josh
2014-07-31 18:34 ` Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 04/10] rcu: Export RCU-tasks APIs to GPL modules Paul E. McKenney
2014-07-31 16:56 ` josh
2014-07-31 20:55 ` Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 05/10] rcutorture: Add torture tests for RCU-tasks Paul E. McKenney
2014-07-31 17:01 ` josh
2014-07-31 20:55 ` Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 06/10] rcutorture: Add RCU-tasks test cases Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 07/10] rcu: Add stall-warning checks for RCU-tasks Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 08/10] rcu: Improve RCU-tasks energy efficiency Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 09/10] documentation: Add verbiage on RCU-tasks stall warning messages Paul E. McKenney
2014-07-31 0:39 ` [PATCH v2 tip/core/rcu 10/10] rcu: Make RCU-tasks track exiting tasks Paul E. McKenney
2014-07-31 7:30 ` [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks() Lai Jiangshan
2014-07-31 16:09 ` Paul E. McKenney
2014-07-31 16:20 ` Peter Zijlstra
2014-07-31 16:47 ` Paul E. McKenney
2014-07-31 16:57 ` Peter Zijlstra
2014-07-31 16:31 ` Oleg Nesterov
2014-07-31 17:02 ` Paul E. McKenney
2014-07-31 17:27 ` Oleg Nesterov
2014-07-31 17:44 ` Paul E. McKenney
2014-08-01 0:53 ` Lai Jiangshan
2014-08-01 2:09 ` Paul E. McKenney
2014-08-01 15:53 ` Oleg Nesterov
2014-08-01 18:19 ` Paul E. McKenney
2014-08-01 18:36 ` Oleg Nesterov
2014-07-31 16:19 ` [PATCH v2 tip/core/rcu 0/10] RCU-tasks implementation josh
2014-07-31 16:30 ` Peter Zijlstra
2014-07-31 16:43 ` josh
2014-07-31 16:49 ` Paul E. McKenney
2014-07-31 16:58 ` Paul E. McKenney
2014-07-31 17:20 ` josh [this message]
2014-07-31 18:38 ` Paul E. McKenney
2014-07-31 20:58 ` josh
2014-07-31 21:11 ` Paul E. McKenney
2014-07-31 19:29 ` Andi Kleen
2014-07-31 21:08 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140731172024.GF12697@cloud \
--to=josh@joshtriplett.org \
--cc=akpm@linux-foundation.org \
--cc=bobby.prani@gmail.com \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dvhart@linux.intel.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).