All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>
Subject: Re: [patch 4/5] sched: RCU sched domains
Date: Mon, 11 Apr 2005 15:15:06 -0700	[thread overview]
Message-ID: <20050411221506.GA1304@us.ibm.com> (raw)
In-Reply-To: <4254E830.5040703@yahoo.com.au>

On Thu, Apr 07, 2005 at 05:58:40PM +1000, Nick Piggin wrote:
> Ingo Molnar wrote:
> >* Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> >
> >
> >>>At a minimum i think we need the fix+comment below.
> >>
> >>Well if we say "this is actually RCU", then yes. And we should 
> >>probably change the preempt_{dis|en}ables in other places to 
> >>rcu_read_lock.
> >>
> >>OTOH, if we say we just want all running threads to process through a 
> >>preemption stage, then this would just be a preempt_disable/enable 
> >>pair.
> >>
> >>In practice that makes no difference yet, but it looks like you and 
> >>Paul are working to distinguish these two cases in the RCU code, to 
> >>accomodate your low latency RCU stuff?
> >
> >
> >it doesnt impact PREEMPT_RCU/PREEMPT_RT directly, because the scheduler 
> >itself always needs to be non-preemptible.
> >
> >those few places where we currently do preempt_disable(), which should 
> >thus be rcu_read_lock(), are never in codepaths that can take alot of 
> >time.
> >
> >but yes, in principle you are right, but in this particular (and 
> >special) case it's not a big issue. We should document the RCU read-lock 
> >dependencies cleanly and make all rcu-read-lock cases truly 
> >rcu_read_lock(), but it's not a pressing issue even considering possible 
> >future features like PREEMPT_RT.
> >
> >the only danger in this area is to PREEMPT_RT: it is a bug on PREEMPT_RT 
> >if kernel code has an implicit 'spinlock means preempt-off and thus 
> >RCU-read-lock' assumption. Most of the time these get discovered via 
> >PREEMPT_DEBUG. (preempt_disable() disables preemption on PREEMPT_RT too, 
> >so that is not a problem either.)
> >
> 
> OK thanks for the good explanation. So I'll keep it as is for now,
> and whatever needs cleaning up later can be worked out as it comes
> up.

Looking forward to the split of synchronize_kernel() into synchronize_rcu()
and synchronize_sched(), the two choices are:

o	Use synchronize_rcu(), but insert rcu_read_lock()/rcu_read_unlock()
	pairs on the read side.

o	Use synchronize_sched(), and make sure all read-side code is
	under preempt_disable().

Either way, there may also need to be some rcu_dereference()s when picking
up pointer and rcu_assign_pointer()s when updating the pointers.
For example, if traversing the domain parent list is to be RCU protected,
the for_each_domain() macro should change to something like:

#define for_each_domain(cpu, domain) \
	for (domain = cpu_rq(cpu)->sd; domain; domain = rcu_dereference(domain->parent))

							Thanx, Paul

  reply	other threads:[~2005-04-11 22:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-05 23:44 [patch 1/5] sched: remove degenerate domains Nick Piggin
2005-04-05 23:45 ` [patch 2/5] sched: NULL domains Nick Piggin
2005-04-05 23:46   ` [patch 3/5] sched: multilevel sbe and sbf Nick Piggin
2005-04-05 23:47     ` [patch 4/5] sched: RCU sched domains Nick Piggin
2005-04-05 23:49       ` [patch 5/5] sched: consolidate sbe sbf Nick Piggin
2005-04-06  6:27         ` Ingo Molnar
2005-04-06  8:09           ` Nick Piggin
2005-04-06  8:16             ` Nick Piggin
2005-04-07  7:17               ` Ingo Molnar
2005-04-07  7:15             ` Ingo Molnar
2005-04-06  6:18       ` [patch 4/5] sched: RCU sched domains Ingo Molnar
2005-04-06  8:01         ` Nick Piggin
2005-04-07  7:11           ` Ingo Molnar
2005-04-07  7:58             ` Nick Piggin
2005-04-11 22:15               ` Paul E. McKenney [this message]
2005-04-12  0:03                 ` Nick Piggin
2005-04-06  5:54     ` [patch 3/5] sched: multilevel sbe and sbf Ingo Molnar
2005-04-06  7:53       ` Nick Piggin
2005-04-06  5:45   ` [patch 2/5] sched: NULL domains Ingo Molnar
2005-04-06  5:48     ` Ingo Molnar
2005-04-06  7:51       ` Nick Piggin
2005-04-06  5:44 ` [patch 1/5] sched: remove degenerate domains Ingo Molnar
2005-04-06  7:10   ` Siddha, Suresh B
2005-04-06  7:13     ` Ingo Molnar
2005-04-06  8:12       ` Nick Piggin
2005-04-06  7:49   ` Nick Piggin
2005-04-07  7:00     ` Ingo Molnar

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=20050411221506.GA1304@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=suresh.b.siddha@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.