All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
	dipankar@in.ibm.com, manfred@colorfullife.com,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	schwidefsky@de.ibm.com
Subject: Re: [patch] RCU: introduce rcu_soon_pending() interface
Date: Tue, 25 Apr 2006 04:46:56 -0700	[thread overview]
Message-ID: <20060425114656.GA16719@us.ibm.com> (raw)
In-Reply-To: <20060425052721.GA9458@osiris.boeblingen.de.ibm.com>

On Tue, Apr 25, 2006 at 07:27:21AM +0200, Heiko Carstens wrote:
> > > @@ -485,6 +485,14 @@ int rcu_pending(int cpu)
> > >  		__rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu));
> > >  }
> > >  
> > > +int rcu_soon_pending(int cpu)
> > > +{
> > > +	struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
> > > +	struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);
> > > +
> > > +	return (!!rdp->curlist || !!rdp_bh->curlist);
> > > +}
> > 
> > This patch sets my nerves a-jangling.
> > 
> > What are the units of soonness?  It's awfully waffly.  Can we specify this
> > more tightly?
> > 
> > Neither rcu_pending() nor rcu_soon_pending() are commented or documented. 
> > Pity the poor user trying to work out what they do, and how they differ. 
> > They're global symbols and they form part of the RCU API - they should be
> > kernel docified, please.
> > 
> > There's probably a reason why neither of these symbols are exported to
> > modules.  Once they're actually documented I mught be able to work out what
> > that reason is ;)
> 
> Maybe rcu_batch_pending() would be a better name for rcu_soon_pending(). Also
> rcu_batch_in_work() would be a more descriptive name for rcu_pending() as far
> as I can tell.
> Actually I was hoping for a better solution from the rcu experts, since I
> don't like this too, but couldn't find something better.

OK, got a look at your patch.

You are using this internally, as part of the RCU -implementation-.
You are determining whether this CPU will still be needed by RCU,
or whether it can be turned off.  So how 'bout calling the (internal)
API something like rcu_needs_cpu()?

int rcu_needs_cpu(int cpu)
{
	struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
	struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu);

	return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu));
}

Then you can drop the rcu_pending() check from your 390 patch.

Seem reasonable?

The meaning of rcu_pending() is "Does RCU have some work pending on
this CPU, so that there is a need to invoke rcu_check_callbacks() on
this CPU?"

							Thanx, Paul

  reply	other threads:[~2006-04-25 11:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 11:11 [patch] RCU: introduce rcu_soon_pending() interface Heiko Carstens
2006-04-24 23:09 ` Andrew Morton
2006-04-25  5:27   ` Heiko Carstens
2006-04-25 11:46     ` Paul E. McKenney [this message]
2006-04-25 11:52       ` Heiko Carstens
2006-04-25 12:08         ` Paul E. McKenney
2006-04-25 12:27           ` [patch] RCU: introduce rcu_needs_cpu() interface Heiko Carstens
     [not found]             ` <20060426141205.58675763.akpm@osdl.org>
2006-04-27  8:11               ` [patch] RCU: add comments to rcu_pending/rcu_needs_cpu Heiko Carstens
2006-05-01 21:57                 ` Paul E. McKenney
2006-05-02  6:35                   ` Heiko Carstens
2006-04-25 12:28           ` [patch] s390: exploit rcu_needs_cpu() interface Heiko Carstens
2006-04-25 11:23   ` [patch] RCU: introduce rcu_soon_pending() interface Paul E. McKenney
2006-04-25 11:33     ` Martin Schwidefsky
2006-04-25 11:48       ` 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=20060425114656.GA16719@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=dipankar@in.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=schwidefsky@de.ibm.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.