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: <1445959673.7476.48.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Tue, 27 Oct 2015 08:27:53 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Josh Cartwright <joshc@...com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	tglx@...utronix.de, bigeasy@...utronix.de,
	linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>,
	Clark Williams <williams@...hat.com>
Subject: Re: [PATCH -rt] Revert "net: use synchronize_rcu_expedited()"

On Tue, 2015-10-27 at 12:02 -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Oct 27, 2015 at 07:18:01AM -0700, Eric Dumazet escreveu:
> > On Tue, 2015-10-27 at 07:31 -0500, Josh Cartwright wrote:
> > 
> > > Okay, yes, I like the first suggestion better as well, I've included a
> > > patch below that does just that.  I hope you don't mind me turning it
> > > into a Suggested-by :).
> > > 
> > > Thanks for taking a look!
> > >   Josh
> > 
> > 
> > > @@ -6969,7 +6969,7 @@ EXPORT_SYMBOL(free_netdev);
> > >  void synchronize_net(void)
> > >  {
> > >  	might_sleep();
> > > -	if (rtnl_is_locked())
> > > +	if (rtnl_is_locked() && !IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
> > >  		synchronize_rcu_expedited();
> > >  	else
> > >  		synchronize_rcu();
> > 
> > No objection from me. Thanks.
> > 
> > Acked-by: Eric Dumazet <edumazet@...gle.com>
> 
> The first suggestion, with it disabled by default seems to be the most
> flexible tho, i.e, Paul's original message plus the boot parameter line:
> 
> Alternatively, a boot-time option could be used:
> 
> int some_rt_boot_parameter = CONFIG_SYNC_NET_DEFAULT;
> 
>         if (rtnl_is_locked() && !some_rt_boot_parameter)
>                 synchronize_rcu_expedited();
>         else
>                 synchronize_rcu();
> 
> Then RT oriented kernel .config files would have CONFIG_SYNC_NET_DEFAULT
> set to 1, while upstream would have this default to 0.
> 
> RT oriented kernel users could try using this in some scenarios where
> networking is not the critical path.


Well, if synchronize_rcu_expedited() is such a problem on RT, then maybe
a generic solution would make synchronize_rcu_expedited() to fallback
synchronize_rcu() after boot time on RT.

Not sure why networking use of synchronize_rcu_expedited() would be
problematic, and not the others.

scripts/checkpatch.pl has this comment about this :

# Check for expedited grace periods that interrupt non-idle non-nohz
# online CPUs.  These expedited can therefore degrade real-time response
# if used carelessly, and should be avoided where not absolutely
# needed.  It is always OK to use synchronize_rcu_expedited() and
# synchronize_sched_expedited() at boot time (before real-time applications
# start) and in error situations where real-time response is compromised in
# any case.  Note that synchronize_srcu_expedited() does -not- interrupt
# other CPUs, so don't warn on uses of synchronize_srcu_expedited().
# Of course, nothing comes for free, and srcu_read_lock() and
# srcu_read_unlock() do contain full memory barriers in payment for
# synchronize_srcu_expedited() non-interruption properties.




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