[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1801172344500.2326@nanos>
Date: Wed, 17 Jan 2018 23:54:05 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: David Miller <davem@...emloft.net>
cc: edumazet@...gle.com, torvalds@...ux-foundation.org, efault@....de,
peterz@...radead.org, dima@...sta.com, frederic@...nel.org,
linux-kernel@...r.kernel.org, 0x7f454c46@...il.com,
akpm@...ux-foundation.org, fweisbec@...il.com,
hannes@...essinduktion.org, mingo@...nel.org,
alexander.levin@...izon.com, pabeni@...hat.com,
paulmck@...ux.vnet.ibm.com, rrendec@...sta.com, riel@...hat.com,
sgruszka@...hat.com, wanpeng.li@...mail.com
Subject: Re: [RFC 1/2] softirq: Defer net rx/tx processing to ksoftirqd
context
On Wed, 17 Jan 2018, David Miller wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> Date: Wed, 17 Jan 2018 14:02:43 -0800
>
> > On Wed, Jan 17, 2018 at 2:00 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> >> On Wed, 17 Jan 2018, Linus Torvalds wrote:
> >>
> >>> On Wed, Jan 17, 2018 at 1:54 PM, Thomas Gleixner <tglx@...utronix.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
Powered by blists - more mailing lists