Re: [PATCH v3 13/15] mm/page_alloc: Add __alloc_frozen_pages()

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

 



On 11/25/24 22:01, Matthew Wilcox (Oracle) wrote:
> Defer the initialisation of the page refcount to the new __alloc_pages()
> wrapper and turn the old __alloc_pages() into __alloc_frozen_pages().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>

But:

> @@ -4804,14 +4804,24 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
>  		free_frozen_pages(page, order);
>  		page = NULL;
>  	}
> -	if (page)
> -		set_page_refcounted(page);
>  
>  	trace_mm_page_alloc(page, order, alloc_gfp, ac.migratetype);
>  	kmsan_alloc_page(page, order, alloc_gfp);
>  
>  	return page;
>  }
> +EXPORT_SYMBOL(__alloc_frozen_pages_noprof);

Since there's no user, we should't export. If a user appears (I can imagine
e.g. KVM), it should be EXPORT_SYMBOL_GPL(). As should have been the rest of
symbols here, but oh well.

> +
> +struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
> +		int preferred_nid, nodemask_t *nodemask)
> +{
> +	struct page *page;
> +
> +	page = __alloc_frozen_pages_noprof(gfp, order, preferred_nid, nodemask);
> +	if (page)
> +		set_page_refcounted(page);
> +	return page;
> +}
>  EXPORT_SYMBOL(__alloc_pages_noprof);
>  
>  struct folio *__folio_alloc_noprof(gfp_t gfp, unsigned int order, int preferred_nid,





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux