lkml.org 
[lkml]   [2012]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4 V2] implement per-domain single-thread state machine call_srcu()
On Sat, Apr 14, 2012 at 03:22:10PM +0200, Peter Zijlstra wrote:
> 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.

Good point.

> > 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 ;-)

If Lai Jiangshan is willing to commit to adding it when/if needed, I
am good with that.

> > > + 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.

Nope. It is hackery inspired by wanting to avoid gratuitous differences
between the SRCU-callback environment and the callback environments of
the other flavors of RCU callbacks. People will move code from one
flavor of RCU to another, and we need to minimize the probability that
they will unwittingly introduce bugs when doing that.

Thanx, Paul

> > > + }
>



\
 
 \ /
  Last update: 2012-04-14 17:29    [W:0.279 / U:0.096 seconds]
©2003-2014 Jasper Spaans. Advertise on this site