Re: [PATCH net v2] net: libwx: fix memory leak on free page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>

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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux