public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Bill Huey <billh@gnuppy.monkey.org>
Cc: Esben Nielsen <nielsen.esben@googlemail.com>,
	linux-kernel@vger.kernel.org, compudj@krystal.dyndns.org,
	rostedt@goodmis.org, tglx@linutronix.de, mingo@elte.hu,
	dipankar@in.ibm.com, rusty@au1.ibm.com
Subject: Re: [RFC, PATCH -rt] NMI-safe mb- and atomic-free RT RCU
Date: Thu, 27 Jul 2006 17:02:31 -0700	[thread overview]
Message-ID: <20060728000231.GB1288@us.ibm.com> (raw)
In-Reply-To: <20060727195355.GA2887@gnuppy.monkey.org>

On Thu, Jul 27, 2006 at 12:53:56PM -0700, Bill Huey wrote:
> On Thu, Jul 27, 2006 at 08:46:37AM -0700, Paul E. McKenney wrote:
> > On Thu, Jul 27, 2006 at 12:00:13PM +0100, Esben Nielsen wrote:
> > > No, RT tasks can still preempt the RCU read side lock. But SCHED_OTHER and 
> > > SCHED_BATCH can't. You can also the RCU read side boosting prioritiy 
> > > dynamic and let the system adjust it or just let the admin adjust it.
> > 
> > Fair enough -- I misread MAX_RT_PRIO as MAX_PRIO.
> > 
> > This approach I can get behind -- my thought has been to boost to
> > either MAX_RT_PRIO or MAX_RT_PRIO-1 when preempt_schedule() sees that
> > it is preempting an RCU read-side critical section.
> > 
> > So I agree with you on at least one point!  ;-)
> 
> This is the approach that I suggested to you, Paul, at OLS after your talk.

Yep.  I have been messing with it for some time, see the RCUboost*
patches in http://www.rdrop.com/users/paulmck/patches/ if you wish
to see a large number of subtly broken ways of approaching this.  ;-)

> Again, if you go about this path then you might think about extending the
> scheduler to have an additional parameter regarding a preemption threshold
> instead of doing this stuff indirectly with priority manipulations like
> the above. It was something that I was considering when I was doing my
> Linux kernel preemption project to fix the problems with RCU-ed read side
> thread migrating to another CPU.
>
> If folks go down this discussion track, it's going to open a can of
> scheduling worms with possiblities (threshold, priority, irq-thread
> priority, global run queue for SCHED_FIFO tasks) pushing into global run
> queue logic stuff. It's a bit spooky for the Linux kernel. Some of the
> thread migration pinning stuff with per CPU locks was rejected by Linus
> way back.

I have been dealing with worms enough for me without the preemption
threshold.  I agree that it might well be useful, but I am getting
my full quota of worms and spookiness with my current approach.  ;-)

> > A possible elaboration would be to keep a linked list of tasks preempted
> > in their RCU read-side critical sections so that they can be further
> > boosted to the highest possible priority (numerical value of zero,
> > not sure what the proper symbol is) if the grace period takes too many
> > jiffies to complete.  Another piece is priority boosting when blocking
> > on a mutex from within an RCU read-side critical section.
> 
> I'm not sure how folks feel about putting something like that in the
> scheduler path since it's such a specialized cases. Some of the scheduler
> folks might come out against this.

They might well.  And the resulting discussion might reveal a better
way.  Or it might well turn out that the simple approach of boosting
to an intermediate level without the list will suffice.

> > Doing it efficiently is the difficulty, particularly for tickless-idle
> > systems where CPUs need to be added and removed on a regular basis.
> > Also, what locking design would you use in order to avoid deadlock?
> > There is a hotplug mutex, but seems like you might need to acquire some
> > number of rq mutexes as well.
> 
> I'm not understanding what you exactly mean by tickless idle systems.

Some architectures power CPUs down (including stopping the scheduling
clock interrupt) when the CPU goes idle for a sufficient time.  The
CPU has sort of been hotplug-removed, but not quite.  In any case, once
the CPU is in that state, RCU needs to count it out of the grace-period
detection.

One difference between the tickless idle and the hot-unplug state is that
a CPU can (and does) enter and exit tickless idle state quite frequently.

> Are you talking about isolating a CPU for SCHED_FIFO and friends tasks
> only as in the CPU reservation stuff but with ticks off in many proprietary
> RTOSes ? Don't mean to be tangental here, I just need clarification.

No.  Although that was something I was messing with a couple of years back,
I am now leaving that to others.

							Thanx, Paul

> > Another approach I am looking at does not permit rcu_read_lock() in
> > NMI/SMI/hardirq, but is much simpler.  Its downside is that it cannot
> > serve as common code between CONFIG_PREEMPT_RT and CONFIG_PREEMPT.
> 
> bill
> 

  reply	other threads:[~2006-07-28  0:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26  0:17 [RFC, PATCH -rt] NMI-safe mb- and atomic-free RT RCU Paul E. McKenney
2006-07-27  1:39 ` Esben Nielsen
2006-07-27  1:39   ` Paul E. McKenney
2006-07-27 11:00     ` Esben Nielsen
2006-07-27 15:46       ` Paul E. McKenney
2006-07-27 19:53         ` Bill Huey
2006-07-28  0:02           ` Paul E. McKenney [this message]
2006-07-28  0:48             ` Bill Huey
2006-07-28  4:56               ` Paul E. McKenney
2006-07-28 11:14                 ` Esben Nielsen
2006-07-28 15:25                   ` Paul E. McKenney
2006-07-28  0:22         ` Esben Nielsen
2006-07-28  0:47           ` 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=20060728000231.GB1288@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=billh@gnuppy.monkey.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nielsen.esben@googlemail.com \
    --cc=rostedt@goodmis.org \
    --cc=rusty@au1.ibm.com \
    --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