[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJtCwB=RdYnAYXU-uZvv=gHJgYD=dcfhohuLi_Qjfv6Ag@mail.gmail.com>
Date: Tue, 26 Nov 2019 14:39:47 -0800
From: Eric Dumazet <edumazet@...gle.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH net 2/2] net: gro: Let the timeout timer expire in softirq
context with `threadirqs'
On Tue, Nov 26, 2019 at 2:20 PM Sebastian Andrzej Siewior
<bigeasy@...utronix.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@...gle.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.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
>
Powered by blists - more mailing lists