lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1334409730.2528.103.camel@twins>
Date:	Sat, 14 Apr 2012 15:22:10 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	paulmck@...ux.vnet.ibm.com
Cc:	Lai Jiangshan <laijs@...fujitsu.com>, linux-kernel@...r.kernel.org,
	mingo@...e.hu, dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, josh@...htriplett.org,
	niv@...ibm.com, tglx@...utronix.de, rostedt@...dmis.org,
	Valdis.Kletnieks@...edu, dhowells@...hat.com,
	eric.dumazet@...il.com, darren@...art.com, fweisbec@...il.com,
	patches@...aro.org
Subject: Re: [PATCH 3/4 V2] implement per-domain single-thread state machine
 call_srcu()

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.

> > +     } 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ