All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@linux.vnet.ibm.com
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de,
	rostedt@goodmis.org, Valdis.Kletnieks@vt.edu,
	dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com,
	fweisbec@gmail.com, patches@linaro.org
Subject: Re: [PATCH 3/4 V2] implement per-domain single-thread state machine call_srcu()
Date: Sat, 14 Apr 2012 15:22:10 +0200	[thread overview]
Message-ID: <1334409730.2528.103.camel@twins> (raw)
In-Reply-To: <20120410231858.GJ2428@linux.vnet.ibm.com>

On Tue, 2012-04-10 at 16:18 -0700, Paul E. McKenney wrote:
> > +static void srcu_invoke_callbacks(struct srcu_struct *sp)
> > +{
> > +     int i;
> > +     struct rcu_head *head;
> > +
> > +     for (i = 0; i < SRCU_CALLBACK_BATCH; i++) {
> 
> If there really can be thousands of callbacks dumped into SRCU, a more
> adaptive strategy might be needed.  In the meantime, I am hoping that
> the fact that the workqueue is retriggered in this case suffices.
> 
> Note that this function is preemptible, so there is less penalty for
> running a very long batch.

With just the ->func() invocation below non-preemptible, I really don't
see a point in having this loop limit.

> Which reminds me...  An srcu_struct structure with a large pile of
> SRCU callbacks won't react very quickly in response to an invocation of
> synchronize_srcu_expedited().  This is why the other RCU implementations
> have a non-callback codepath for expedited grace periods.
> 
> Or am I missing something here?

I would suggest adding that extra complexity when we need it ;-)

> > +             head = rcu_batch_dequeue(&sp->batch_done);
> > +             if (!head)
> > +                     break;
> > +             head->func(head);
> 
> I have surrounded this with local_bh_disable() and local_bh_enable()
> in order to enforce the no-sleeping-in-callbacks rule.  Please let me
> know if I missed some other enforcement mechanism.

Is that -rt inspired hackery? Otherwise I would simply suggest
preempt_disable/enable(), they do pretty much the same and are less
confusing.

> > +     } 

  parent reply	other threads:[~2012-04-14 13:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19  8:12 [PATCH 0/4 V2] rcu: implement call_srcu() Lai Jiangshan
2012-03-19  8:12 ` [PATCH 1/4 V2] rcu: fix srcu_readers_active() Lai Jiangshan
2012-03-19  8:12 ` [PATCH 2/4 V2] rcu: use "int trycount" instead of "bool expedited" Lai Jiangshan
2012-03-19  8:12 ` [PATCH 3/4 V2] implement per-domain single-thread state machine call_srcu() Lai Jiangshan
2012-04-10 23:18   ` Paul E. McKenney
2012-04-11 12:27     ` Paul E. McKenney
2012-04-14 13:22     ` Peter Zijlstra [this message]
2012-04-14 15:26       ` Paul E. McKenney
2012-03-19  8:12 ` [PATCH 4/4 V2] add srcu torture test Lai Jiangshan

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=1334409730.2528.103.camel@twins \
    --to=peterz@infradead.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --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 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.