From: Thomas Gleixner <tglx@linutronix.de>
To: David Miller <davem@davemloft.net>
Cc: edumazet@google.com, torvalds@linux-foundation.org,
efault@gmx.de, peterz@infradead.org, dima@arista.com,
frederic@kernel.org, linux-kernel@vger.kernel.org,
0x7f454c46@gmail.com, akpm@linux-foundation.org,
fweisbec@gmail.com, hannes@stressinduktion.org, mingo@kernel.org,
alexander.levin@verizon.com, pabeni@redhat.com,
paulmck@linux.vnet.ibm.com, rrendec@arista.com, riel@redhat.com,
sgruszka@redhat.com, wanpeng.li@hotmail.com
Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context
Date: Wed, 17 Jan 2018 23:54:05 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1801172344500.2326@nanos> (raw)
In-Reply-To: <20180117.172447.1568697383040902713.davem@davemloft.net>
On Wed, 17 Jan 2018, David Miller wrote:
> From: Eric Dumazet <edumazet@google.com>
> Date: Wed, 17 Jan 2018 14:02:43 -0800
>
> > On Wed, Jan 17, 2018 at 2:00 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> On Wed, 17 Jan 2018, Linus Torvalds wrote:
> >>
> >>> On Wed, Jan 17, 2018 at 1:54 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >>> > raise_softirq() -> raise_softirq_irqoff()
> >>> >
> >>> > set_softirq_bit();
> >>> >
> >>> > if (!in_interrupt())
> >>> > wake_softirqd();
> >>> >
> >>> > So if the caller is not in hard or soft interrupt context, which includes
> >>> > bottom half disabled regions softirqd is woken.
> >>>
> >>> That does seem unnecessarily expensive, and maybe we could just do it
> >>> with thread flag (TIF_NOTIFY_RESUME or whatever).
> >>>
> >>> In fact, that was what I *thought* we did. Maybe I just remember some
> >>> historical behavior.
> >>>
> >>> Since networking seems to largely prefer softirqd anyway, maybe that
> >>> wake_softirqd() is the right thing to do anyway.
> >>
> >> Well, but we only do it when we are not in a bh disabled region. The places
> >> where thread context raises the network softirqs is usually inside a bh
> >> disabled region, so the softirq is executed on local_bh_enable(). The
> >> thread is woken up rarely.
> >
> > There is also the netif_rx_ni() stuff.
> >
> > Can't remember right now why it is not using
> > local_bh_{diable,enable}() pair instead
> > of preempt_disable() ... if (local_softirq_pending()) do_softirq();
>
> Hmmm, that code predates the initial GIT repository build.
>
> I do remember we had some back and forth with that stuff.
commit 3ace873f40916682583562c1e1f324a4a50a2811 in
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
deinlines that function and drops a comment while at it:
-/* Post buffer to the network code from _non interrupt_ context.
- * see net/core/dev.c for netif_rx description.
- */
-static inline int netif_rx_ni(struct sk_buff *skb)
It was added somewhere around 2.5.0
Thanks,
tglx
next prev parent reply other threads:[~2018-01-17 22:54 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 13:36 [RFC 0/2] Net softirq deferring to ksoftirqd Dmitry Safonov
2018-01-09 13:36 ` [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd context Dmitry Safonov
2018-01-09 16:03 ` Frederic Weisbecker
2018-01-10 21:20 ` Dmitry Safonov
2018-01-09 18:02 ` Eric Dumazet
2018-01-10 21:48 ` Dmitry Safonov
2018-01-11 2:13 ` Linus Torvalds
2018-01-11 3:22 ` Frederic Weisbecker
2018-01-11 4:19 ` Linus Torvalds
2018-01-11 4:44 ` Frederic Weisbecker
2018-01-11 14:31 ` Dmitry Safonov
2018-01-11 16:20 ` Eric Dumazet
2018-01-11 16:32 ` Peter Zijlstra
2018-01-11 16:38 ` David Miller
2018-01-11 16:43 ` Peter Zijlstra
2018-01-11 18:48 ` Linus Torvalds
2018-01-11 19:15 ` Eric Dumazet
2018-01-11 19:43 ` Linus Torvalds
2018-01-11 19:48 ` Eric Dumazet
2018-01-11 20:03 ` Linus Torvalds
2018-01-11 20:16 ` Eric Dumazet
2018-01-11 20:22 ` Linus Torvalds
2018-01-11 20:34 ` Dmitry Safonov
2018-01-11 20:37 ` Eric Dumazet
2018-01-11 20:40 ` Linus Torvalds
2018-01-11 20:46 ` Dmitry Safonov
2018-01-11 20:53 ` Eric Dumazet
2018-01-11 21:13 ` Dmitry Safonov
2018-01-12 5:41 ` Frederic Weisbecker
2018-01-12 5:23 ` Mike Galbraith
2018-01-12 10:13 ` Peter Zijlstra
2018-01-12 17:26 ` Linus Torvalds
2018-01-12 17:44 ` Mike Galbraith
2018-01-12 17:51 ` Linus Torvalds
2018-01-12 18:15 ` Mike Galbraith
2018-01-12 18:44 ` Mike Galbraith
2018-01-17 20:30 ` David Miller
2018-01-17 21:06 ` Linus Torvalds
2018-01-17 21:49 ` David Miller
2018-01-17 21:54 ` Thomas Gleixner
2018-01-17 21:58 ` Linus Torvalds
2018-01-17 22:00 ` Thomas Gleixner
2018-01-17 22:02 ` Eric Dumazet
2018-01-17 22:24 ` David Miller
2018-01-17 22:54 ` Thomas Gleixner [this message]
2018-02-06 16:56 ` Sebastian Andrzej Siewior
2018-02-13 16:36 ` Thomas Gleixner
2018-01-17 21:54 ` Linus Torvalds
2018-01-17 21:58 ` Thomas Gleixner
2018-01-12 19:28 ` Thomas Gleixner
2018-01-12 19:53 ` Frederic Weisbecker
2018-01-12 14:58 ` Frederic Weisbecker
2018-01-12 15:15 ` Mike Galbraith
2018-01-12 17:00 ` Frederic Weisbecker
2018-01-12 18:08 ` Mike Galbraith
2018-01-12 17:24 ` Linus Torvalds
2018-01-09 13:36 ` [RFC 2/2] softirq: Introduce mask for __do_softirq() Dmitry Safonov
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=alpine.DEB.2.20.1801172344500.2326@nanos \
--to=tglx@linutronix.de \
--cc=0x7f454c46@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.levin@verizon.com \
--cc=davem@davemloft.net \
--cc=dima@arista.com \
--cc=edumazet@google.com \
--cc=efault@gmx.de \
--cc=frederic@kernel.org \
--cc=fweisbec@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pabeni@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rrendec@arista.com \
--cc=sgruszka@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=wanpeng.li@hotmail.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
all inboxes | Powered by JetHome®