[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 11 Dec 2023 19:01:16 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: duanqiangwen <duanqiangwen@...-swift.com>
Cc: netdev@...r.kernel.org, jiawenwu@...stnetic.com,
mengyuanlou@...-swift.com, davem@...emloft.net, pabeni@...hat.com,
yang.lee@...ux.alibaba.com, shaozhengchao@...wei.com, error27@...il.com,
andrew@...n.ch, stable@...r.kernel.org
Subject: Re: [PATCH net v2] net: libwx: fix memory leak on free page
On Fri, 8 Dec 2023 16:02:16 +0800 duanqiangwen wrote:
> ifconfig ethx up, will set page->refcount larger than 1,
> and then ifconfig ethx down, calling __page_frag_cache_drain()
> to free pages, it is not compatible with page pool.
> So deleting codes which changing page->refcount.
>
> Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")
>
> Signed-off-by: duanqiangwen <duanqiangwen@...-swift.com>
nit: no empty line between Fixes and Signed-off-by, please fix and
repost
> @@ -335,11 +269,12 @@ static struct sk_buff *wx_build_skb(struct wx_ring *rx_ring,
> if (size <= WX_RXBUFFER_256) {
> memcpy(__skb_put(skb, size), page_addr,
> ALIGN(size, sizeof(long)));
> - rx_buffer->pagecnt_bias++;
> -
> + page_pool_put_full_page(rx_ring->page_pool, rx_buffer->page, false);
FWIW I'm 90% sure you can pass true as the last argument here.
The rule for "allow direct recycling" is basically - are you
in the same context the context which will allocate from this
page pool.
--
pw-bot: cr
Powered by blists - more mailing lists