lkml.org 
[lkml]   [2023]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 RFC 2/6] page_pool: unify frag_count handling in page_pool_is_last_frag()
From
Date
On 2023/7/10 22:39, Alexander Lobakin wrote:
> From: Yunsheng Lin <linyunsheng@huawei.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.

Yes, thanks.

>

\
 
 \ /
  Last update: 2023-07-11 13:49    [W:0.137 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site