[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izMWBDm5VDYOeJDy5J-pbLtsiBnP801PC17XAbzCb2oe-g@mail.gmail.com>
Date: Wed, 5 Jun 2024 09:30:52 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: David Wei <dw@...idwei.uk>
Cc: Jesper Dangaard Brouer <hawk@...nel.org>, Ilias Apalodimas <ilias.apalodimas@...aro.org>, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v1] page_pool: remove WARN_ON() with OR
On Wed, Jun 5, 2024 at 9:20 AM David Wei <dw@...idwei.uk> wrote:
>
> Having an OR in WARN_ON() makes me sad because it's impossible to tell
> which condition is true when triggered.
>
> Split a WARN_ON() with an OR in page_pool_disable_direct_recycling().
>
> Signed-off-by: David Wei <dw@...idwei.uk>
Reviewed-by: Mina Almasry <almasrymina@...gle.com>
> ---
> net/core/page_pool.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index f4444b4e39e6..3927a0a7fa9a 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -1027,8 +1027,8 @@ static void page_pool_disable_direct_recycling(struct page_pool *pool)
> /* To avoid races with recycling and additional barriers make sure
> * pool and NAPI are unlinked when NAPI is disabled.
> */
> - WARN_ON(!test_bit(NAPI_STATE_SCHED, &pool->p.napi->state) ||
> - READ_ONCE(pool->p.napi->list_owner) != -1);
> + WARN_ON(!test_bit(NAPI_STATE_SCHED, &pool->p.napi->state));
> + WARN_ON(READ_ONCE(pool->p.napi->list_owner) != -1);
>
> WRITE_ONCE(pool->p.napi, NULL);
> }
> --
> 2.43.0
>
>
--
Thanks,
Mina
Powered by blists - more mailing lists