Skip to contentSkip to conversation

mm-page_alloc-add-kernel-docs-for-free_pages.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 21, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/page_alloc: add kernel-docs for free_pages()
has been removed from the -mm tree. Its filename was
mm-page_alloc-add-kernel-docs-for-free_pages.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Vishal Moola (Oracle)" <[email protected]>
Subject: mm/page_alloc: add kernel-docs for free_pages()
Date: Wed, 3 Sep 2025 11:59:15 -0700

Patch series "Cleanup free_pages() misuse", v3.

free_pages() is supposed to be called when we only have a virtual address. __free_pages() is supposed to be called when we have a page.

There are a number of callers that use page_address() to get a page's virtual address then call free_pages() on it when they should just call __free_pages() directly.

Add kernel-docs for free_pages() to help callers better understand which function they should be calling, and replace the obvious cases of misuse.

This patch (of 7):

Add kernel-docs to free_pages(). This will help callers understand when to use it instead of __free_pages().

---

 mm/page_alloc.c |    9 +++++++++
 1 file changed, 9 insertions(+)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_alloc-add-kernel-docs-for-free_pages +9 -0
@@ -5275,6 +5275,15 @@ void free_pages_nolock(struct page *page
 	___free_pages(page, order, FPI_TRYLOCK);
 }
 
+/**
+ * free_pages - Free pages allocated with __get_free_pages().
+ * @addr: The virtual address tied to a page returned from __get_free_pages().
+ * @order: The order of the allocation.
+ *
+ * This function behaves the same as __free_pages(). Use this function
+ * to free pages when you only have a valid virtual address. If you have
+ * the page, call __free_pages() instead.
+ */
 void free_pages(unsigned long addr, unsigned int order)
 {
 	if (addr != 0) {

_

Patches currently in -mm which might be from [email protected] are