From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Esben Nielsen <simlo@phys.au.dk>
Cc: Ingo Molnar <mingo@elte.hu>,
dipankar@in.ibm.com, shemminger@osdl.org, akpm@osdl.org,
torvalds@osdl.org, rusty@au1.ibm.com, tgall@us.ibm.com,
jim.houston@comcast.net, manfred@colorfullife.com, gh@us.ibm.com,
linux-kernel@vger.kernel.org
Subject: Re: Real-Time Preemption and RCU
Date: Tue, 22 Mar 2005 21:40:34 -0800 [thread overview]
Message-ID: <20050323054034.GC1294@us.ibm.com> (raw)
In-Reply-To: <Pine.OSF.4.05.10503220929500.5287-100000@da410.phys.au.dk>
On Tue, Mar 22, 2005 at 09:55:26AM +0100, Esben Nielsen wrote:
> On Mon, 21 Mar 2005, Paul E. McKenney wrote:
[ . . . ]
> > On Mon, Mar 21, 2005 at 12:23:22AM +0100, Esben Nielsen wrote:
> > This is in some ways similar to the K42 approach to RCU (which they call
> > "generations"). Dipankar put together a similar patch for Linux, but
> > the problem was that grace periods could be deferred for an extremely
> > long time. Which I suspect is what you were calling out as causing
> > RCU batches never to run.
>
> That is where the preempt_by_nonrt_disable/enable() is supposed to help:
> Then it can't take longer than the normal kernel in the situation where
> there is no RT tasks running. RT tasks will prolong the grace periods if
> they go into RCU regions, but they are supposed to be relatively small -
> and deterministic!
The part that I am missing is how this helps in the case where a non-RT
task gets preempted in the middle of an RCU read-side critical section
indefinitely. Or are you boosting the priority of any task that
enters an RCU read-side critical section?
> > > > The counter approach might work, and is also what the implementation #5
> > > > does -- check out rcu_read_lock() in Ingo's most recent patch.
> > > >
> > >
> > > Do you refer to your original mail with implementing it in 5 steps?
> > > In #5 in that one (-V0.7.41-00, right?) you use a lock and as you say that
> > > forces syncronization between the CPUs - bad for scaling. It does make the
> > > RCU batches somewhat deterministic, as the RCU task can boost the readers
> > > to the rcu-task's priority.
> > > The problem about this approach is that everybody calling into RCU code
> > > have a worst case behaviour of the systemwide worst case RCU reader
> > > section - which can be pretty large (in principle infinite if somebody.)
> > > So if somebody uses a call to a function in the code containing a RCU read
> > > area the worst case behavious would be the same as teh worst case latency
> > > in the simple world where preempt_disable()/preempt_enable() was used.
> >
> > I missed something here -- readers would see the worst-case -writer-
> > latency rather than the worst-case -reader- latency, right? Or are you
> > concerned about the case where some reader blocks the write-side
> > acquisitions in _synchronize_kernel(), but not before the writer has
> > grabbed a lock, blocking any readers on the corresponding CPU?
>
> I am conserned that readers block each other, too. You do need an rw-mutex
> allowing an unlimited number of readers for doing this. With the current
> rw-mutex the readers block each other. I.e. the worst case latency is the
> worst case reader latency - globally!
> On the other hand with a rw-lock being unlimited - and thus do not keep
> track of it readers - the readers can't be boosted by the writer. Then you
> are back to square 1: The grace period can take a very long time.
OK, good point.
> > Yes, but this is true of every other lock in the system as well, not?
>
> Other locks are not globaly used but only used for a specific subsystem.
> On a real-time system you are supposed to know which subsystems you can
> call into and still have a low enough latency as each subsystem has it's
> own bound. But with a global RCU locking mechanism all RCU using code is
> to be regarded as _one_ such subsystem.
Yep. As would the things protected by the dcache lock, task list lock,
and so on, right?
Thanx, Paul
> > In a separate conversation a few weeks ago, Steve Hemminger suggested
> > placing checks in long RCU read-side critical sections -- this could
> > be used to keep the worst-case reader latency within the desired bounds.
> > Not pretty, but, then again, bounding lock latency will require a fair
> > number of similar changes, I suspect.
> >
> > Thanx, Paul
> >
>
> Esben
>
>
next prev parent reply other threads:[~2005-03-23 5:40 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-18 0:20 Real-Time Preemption and RCU Paul E. McKenney
2005-03-18 7:49 ` Ingo Molnar
2005-03-18 16:43 ` Paul E. McKenney
2005-03-18 17:11 ` Ingo Molnar
2005-03-18 17:29 ` Paul E. McKenney
2005-03-18 20:35 ` Paul E. McKenney
2005-03-18 22:22 ` Paul E. McKenney
2005-03-19 0:48 ` Paul E. McKenney
2005-03-18 8:44 ` Ingo Molnar
2005-03-18 9:04 ` Ingo Molnar
2005-03-18 9:38 ` Ingo Molnar
2005-03-18 9:13 ` Ingo Molnar
2005-03-18 9:28 ` Ingo Molnar
2005-03-18 9:53 ` Ingo Molnar
2005-03-18 15:33 ` Paul E. McKenney
2005-03-19 5:03 ` Manfred Spraul
2005-03-19 16:26 ` Ingo Molnar
2005-03-20 6:36 ` Manfred Spraul
2005-03-20 9:25 ` Thomas Gleixner
2005-03-20 16:57 ` Manfred Spraul
2005-03-20 21:38 ` Bill Huey
2005-03-20 21:59 ` Bill Huey
2005-03-18 10:03 ` Ingo Molnar
2005-03-18 11:30 ` Ingo Molnar
2005-03-18 16:48 ` Esben Nielsen
2005-03-18 17:19 ` Ingo Molnar
2005-03-20 13:29 ` Esben Nielsen
2005-03-20 22:38 ` Paul E. McKenney
2005-03-20 23:23 ` Esben Nielsen
2005-03-22 5:53 ` Paul E. McKenney
2005-03-22 8:55 ` Esben Nielsen
2005-03-22 9:20 ` Ingo Molnar
2005-03-22 10:19 ` Esben Nielsen
2005-03-23 5:40 ` Paul E. McKenney [this message]
2005-03-23 11:44 ` Esben Nielsen
2005-03-24 7:02 ` Paul E. McKenney
2005-03-22 10:56 ` Ingo Molnar
2005-03-22 11:39 ` Esben Nielsen
2005-03-22 13:10 ` Ingo Molnar
2005-03-22 15:08 ` Esben Nielsen
2005-03-18 15:48 ` Paul E. McKenney
2005-03-18 11:38 ` Ingo Molnar
2005-03-18 12:56 ` Bill Huey
2005-03-18 13:17 ` Bill Huey
2005-03-18 15:57 ` Paul E. McKenney
2005-03-18 16:02 ` Ingo Molnar
2005-03-18 16:55 ` Esben Nielsen
2005-03-22 10:04 ` Bill Huey
2005-03-22 10:17 ` Bill Huey
2005-03-22 10:34 ` Bill Huey
2005-03-22 10:38 ` Esben Nielsen
2005-03-18 22:26 ` Herbert Xu
2005-03-19 16:31 ` Ingo Molnar
2005-03-20 8:01 ` Kyle Moffett
2005-03-22 8:08 ` Ingo Molnar
2005-03-18 15:54 ` Paul E. McKenney
2005-03-18 15:58 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2009-06-11 22:57 real-time preemption " James Huang
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=20050323054034.GC1294@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=akpm@osdl.org \
--cc=dipankar@in.ibm.com \
--cc=gh@us.ibm.com \
--cc=jim.houston@comcast.net \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mingo@elte.hu \
--cc=rusty@au1.ibm.com \
--cc=shemminger@osdl.org \
--cc=simlo@phys.au.dk \
--cc=tgall@us.ibm.com \
--cc=torvalds@osdl.org \
/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