[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5F886589-4EE7-43D7-8292-4D8CCDCDEF9E@gmail.com>
Date: Tue, 10 Mar 2020 09:52:31 -0700
From: "Jonathan Lemon" <jonathan.lemon@...il.com>
To: "David Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org, brouer@...hat.com,
ilias.apalodimas@...aro.org, kernel-team@...com
Subject: Re: [PATCH] page_pool: use irqsave/irqrestore to protect ring access.
On 9 Mar 2020, at 17:55, David Miller wrote:
> From: Jonathan Lemon <jonathan.lemon@...il.com>
> Date: Mon, 9 Mar 2020 12:49:29 -0700
>
>> netpoll may be called from IRQ context, which may access the
>> page pool ring. The current _bh variants do not provide sufficient
>> protection, so use irqsave/restore instead.
>>
>> Error observed on a modified mlx4 driver, but the code path exists
>> for any driver which calls page_pool_recycle from napi poll.
>>
>> WARNING: CPU: 34 PID: 550248 at /ro/source/kernel/softirq.c:161
>> __local_bh_enable_ip+0x35/0x50
> ...
>> Signed-off-by: Jonathan Lemon <jonathan.lemon@...il.com>
>
> The netpoll stuff always makes the locking more complicated than it
> needs
> to be. I wonder if there is another way around this issue?
>
> Because IRQ save/restore is a high cost to pay in this critical path.
I agree with this - the proposed patch is more of a bandaid than
anything else. Why is the entire network poll path being called
with IRQs off? That seems wrong - while netcons is expected to
work in all cases, it does seem like it should be smarter and for
the normal case, just queue and raise NET_TX_SOFTIRQ would be a
more logical path.
--
Jonathan
Powered by blists - more mailing lists