Skip to content

Commit 1301a2c

Browse files
committed
mm: restore documentation for __free_pages()
JIRA: https://issues.redhat.com/browse/RHEL-78202 Conflicts: - conflicts due to missing mm series "Allocate and free frozen pages" commit 3091b61 Author: Matthew Wilcox (Oracle) <willy@infradead.org> Date: Wed Jun 4 20:03:26 2025 +0100 mm: restore documentation for __free_pages() The documentation was converted to be for ___free_pages(), which doesn't need documentation as it's static. Link: https://lkml.kernel.org/r/20250604190327.814086-1-willy@infradead.org Fixes: 8c57b68 (mm, bpf: Introduce free_pages_nolock()) Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Cc: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Gregory Bell <grbell@redhat.com>
1 parent 60f7b35 commit 1301a2c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

mm/page_alloc.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4872,11 +4872,27 @@ unsigned long get_zeroed_page_noprof(gfp_t gfp_mask)
48724872
}
48734873
EXPORT_SYMBOL(get_zeroed_page_noprof);
48744874

4875+
static void ___free_pages(struct page *page, unsigned int order,
4876+
fpi_t fpi_flags)
4877+
{
4878+
/* get PageHead before we drop reference */
4879+
int head = PageHead(page);
4880+
struct alloc_tag *tag = pgalloc_tag_get(page);
4881+
4882+
if (put_page_testzero(page))
4883+
__free_unref_page(page, order, fpi_flags);
4884+
else if (!head) {
4885+
pgalloc_tag_sub_pages(tag, (1 << order) - 1);
4886+
while (order-- > 0)
4887+
__free_unref_page(page + (1 << order), order,
4888+
fpi_flags);
4889+
}
4890+
}
4891+
48754892
/**
4876-
* ___free_pages - Free pages allocated with alloc_pages().
4893+
* __free_pages - Free pages allocated with alloc_pages().
48774894
* @page: The page pointer returned from alloc_pages().
48784895
* @order: The order of the allocation.
4879-
* @fpi_flags: Free Page Internal flags.
48804896
*
48814897
* This function can free multi-page allocations that are not compound
48824898
* pages. It does not check that the @order passed in matches that of
@@ -4893,22 +4909,6 @@ EXPORT_SYMBOL(get_zeroed_page_noprof);
48934909
* Context: May be called in interrupt context or while holding a normal
48944910
* spinlock, but not in NMI context or while holding a raw spinlock.
48954911
*/
4896-
static void ___free_pages(struct page *page, unsigned int order,
4897-
fpi_t fpi_flags)
4898-
{
4899-
/* get PageHead before we drop reference */
4900-
int head = PageHead(page);
4901-
struct alloc_tag *tag = pgalloc_tag_get(page);
4902-
4903-
if (put_page_testzero(page))
4904-
__free_unref_page(page, order, fpi_flags);
4905-
else if (!head) {
4906-
pgalloc_tag_sub_pages(tag, (1 << order) - 1);
4907-
while (order-- > 0)
4908-
__free_unref_page(page + (1 << order), order,
4909-
fpi_flags);
4910-
}
4911-
}
49124912
void __free_pages(struct page *page, unsigned int order)
49134913
{
49144914
___free_pages(page, order, FPI_NONE);

0 commit comments

Comments
 (0)