From: Eric Dumazet <eric.dumazet@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Josh Cartwright <joshc@ni.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
tglx@linutronix.de, bigeasy@linutronix.de,
linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Clark Williams <williams@redhat.com>
Subject: Re: [PATCH -rt] Revert "net: use synchronize_rcu_expedited()"
Date: Tue, 27 Oct 2015 08:27:53 -0700 [thread overview]
Message-ID: <1445959673.7476.48.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <20151027150251.GH9405@kernel.org>
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@google.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.
next prev parent reply other threads:[~2015-10-27 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 19:14 [PATCH -rt] Revert "net: use synchronize_rcu_expedited()" Josh Cartwright
2015-10-27 0:44 ` Paul E. McKenney
2015-10-27 12:31 ` Josh Cartwright
2015-10-27 14:18 ` Eric Dumazet
2015-10-27 15:02 ` Arnaldo Carvalho de Melo
2015-10-27 15:27 ` Eric Dumazet [this message]
2015-10-27 23:15 ` Paul E. McKenney
2015-10-28 8:34 ` Josh Cartwright
2015-10-28 12:27 ` Paul E. McKenney
2015-10-30 9:16 ` David Miller
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=1445959673.7476.48.camel@edumazet-glaptop2.roam.corp.google.com \
--to=eric.dumazet@gmail.com \
--cc=acme@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=joshc@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).