lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e201644d-c9bd-52d9-9d26-a18bc4def21f@intel.com>
Date: Mon, 10 Jul 2023 16:39:20 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Yunsheng Lin <linyunsheng@...wei.com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Lorenzo Bianconi
	<lorenzo@...nel.org>, Alexander Duyck <alexander.duyck@...il.com>, Liang Chen
	<liangchen.linux@...il.com>, Jesper Dangaard Brouer <hawk@...nel.org>, "Ilias
 Apalodimas" <ilias.apalodimas@...aro.org>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH v5 RFC 2/6] page_pool: unify frag_count handling in
 page_pool_is_last_frag()

From: Yunsheng Lin <linyunsheng@...wei.com>
Date: Thu, 29 Jun 2023 20:02:22 +0800

> Currently when page_pool_create() is called with
> PP_FLAG_PAGE_FRAG flag, page_pool_alloc_pages() is only
> allowed to be called under the below constraints:
> 1. page_pool_fragment_page() need to be called to setup
>    page->pp_frag_count immediately.
> 2. page_pool_defrag_page() often need to be called to drain
>    the page->pp_frag_count when there is no more user will
>    be holding on to that page.

[...]

> @@ -352,12 +377,10 @@ static inline bool page_pool_is_last_frag(struct page_pool *pool,
>  {
>  	/* We assume we are the last frag user that is still holding
>  	 * on to the page if:
> -	 * 1. Fragments aren't enabled.
> -	 * 2. We are running in 32-bit arch with 64-bit DMA.
> -	 * 3. page_pool_defrag_page() indicate we are the last user.
> +	 * 1. We are running in 32-bit arch with 64-bit DMA.
> +	 * 2. page_pool_defrag_page() indicate we are the last user.
>  	 */
> -	return !(pool->p.flags & PP_FLAG_PAGE_FRAG) ||
> -	       PAGE_POOL_DMA_USE_PP_FRAG_COUNT ||
> +	return PAGE_POOL_DMA_USE_PP_FRAG_COUNT ||
>  	       (page_pool_defrag_page(page, 1) == 0);

Just noticed while developing: after this change, the first function
argument, i.e. @pool, is not needed anymore and can be removed.

[...]

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ