From: Eric Dumazet <edumazet@google.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: netdev <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH net 2/2] net: gro: Let the timeout timer expire in softirq context with `threadirqs'
Date: Tue, 26 Nov 2019 14:39:47 -0800 [thread overview]
Message-ID: <CANn89iJtCwB=RdYnAYXU-uZvv=gHJgYD=dcfhohuLi_Qjfv6Ag@mail.gmail.com> (raw)
In-Reply-To: <20191126222013.1904785-3-bigeasy@linutronix.de>
On Tue, Nov 26, 2019 at 2:20 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> The timer callback (napi_watchdog()) invokes __napi_schedule_irqoff()
> with disabled interrupts. With the `threadirqs' commandline option all
> interrupt handler are threaded and using __napi_schedule_irqoff() is not
> an issue because everyone is using it in threaded context which is
> synchronised with local_bh_disable().
> The napi_watchdog() timer is still expiring in hardirq context and may
> interrupt a threaded handler which is in the middle of
> __napi_schedule_irqoff() leading to list corruption.
Sorry, I do not understand this changelog.
Where/how do you get list corruption exactly ?
__napi_schedule_irqoff() _has_ to be called with hard IRQ disabled.
Please post a stack trace.
>
> Let the napi_watchdog() expire in softirq context if `threadirqs' is
> used.
>
> Fixes: 3b47d30396bae ("net: gro: add a per device gro flush timer")
Are you sure this commit is the root cause of the problem you see ?
> Cc: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> net/core/dev.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 99ac84ff398f4..ec533d20931bc 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5994,6 +5994,8 @@ bool napi_complete_done(struct napi_struct *n, int work_done)
> napi_gro_flush(n, !!timeout);
> if (timeout)
> hrtimer_start(&n->timer, ns_to_ktime(timeout),
> + force_irqthreads ?
Honestly something is wrong with this patch, force_irqthreads should
not be used in net/ territory,
that is some layering problem.
> + HRTIMER_MODE_REL_PINNED_SOFT :
> HRTIMER_MODE_REL_PINNED);
> }
> if (unlikely(!list_empty(&n->poll_list))) {
> @@ -6225,7 +6227,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
> int (*poll)(struct napi_struct *, int), int weight)
> {
> INIT_LIST_HEAD(&napi->poll_list);
> - hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
> + hrtimer_init(&napi->timer, CLOCK_MONOTONIC,
> + force_irqthreads ?
> + HRTIMER_MODE_REL_PINNED_SOFT : HRTIMER_MODE_REL_PINNED);
> napi->timer.function = napi_watchdog;
> init_gro_hash(napi);
> napi->skb = NULL;
> --
> 2.24.0
>
next prev parent reply other threads:[~2019-11-26 22:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 22:20 [PATCH net 0/2] __napi_schedule_irqoff() used in wrong context Sebastian Andrzej Siewior
2019-11-26 22:20 ` [PATCH net 1/2] amd-xgbe: Use __napi_schedule() in BH context Sebastian Andrzej Siewior
2019-12-02 17:19 ` Tom Lendacky
2020-04-16 13:52 ` Sebastian Andrzej Siewior
2020-04-16 15:19 ` Eric Dumazet
2019-11-26 22:20 ` [PATCH net 2/2] net: gro: Let the timeout timer expire in softirq context with `threadirqs' Sebastian Andrzej Siewior
2019-11-26 22:39 ` Eric Dumazet [this message]
2019-11-27 9:35 ` Sebastian Andrzej Siewior
[not found] ` <CANn89iL=q2wwjdSj1=veBE0hDATm_K=akKhz3Dyddnk28DRJhg@mail.gmail.com>
2019-11-27 17:11 ` Eric Dumazet
2019-11-27 17:37 ` Sebastian Andrzej Siewior
2020-04-16 13:59 ` Sebastian Andrzej Siewior
2021-03-17 14:10 ` Thomas Gleixner
2021-03-17 14:50 ` Eric Dumazet
2019-11-27 17:22 ` Sebastian Andrzej Siewior
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='CANn89iJtCwB=RdYnAYXU-uZvv=gHJgYD=dcfhohuLi_Qjfv6Ag@mail.gmail.com' \
--to=edumazet@google.com \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
/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).