linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, Alexei Starovoitov <ast@kernel.org>
Subject: [PATCH 3/3] mm: Remove page->order
Date: Wed, 10 Sep 2025 15:29:19 +0100	[thread overview]
Message-ID: <20250910142923.2465470-4-willy@infradead.org> (raw)
In-Reply-To: <20250910142923.2465470-1-willy@infradead.org>

We already use page->private for storing the order of a page while it's
in the buddy allocator system; extend that to also storing the order
while it's in the pcp_llist.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Alexei Starovoitov <ast@kernel.org>
---
 include/linux/mm_types.h | 8 +++-----
 mm/page_alloc.c          | 4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 4a441f78340d..569265d159a5 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -97,10 +97,7 @@ struct page {
 				/* Or, free page */
 				struct list_head buddy_list;
 				struct list_head pcp_list;
-				struct {
-					struct llist_node pcp_llist;
-					unsigned int order;
-				};
+				struct llist_node pcp_llist;
 			};
 			struct address_space *mapping;
 			union {
@@ -111,7 +108,8 @@ struct page {
 			 * @private: Mapping-private opaque data.
 			 * Usually used for buffer_heads if PagePrivate.
 			 * Used for swp_entry_t if swapcache flag set.
-			 * Indicates order in the buddy system if PageBuddy.
+			 * Indicates order in the buddy system if PageBuddy
+			 * or on pcp_llist.
 			 */
 			unsigned long private;
 		};
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d21a411e807e..e71e23d1a747 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1520,7 +1520,7 @@ static void add_page_to_zone_llist(struct zone *zone, struct page *page,
 				   unsigned int order)
 {
 	/* Remember the order */
-	page->order = order;
+	page->private = order;
 	/* Add the page to the free list */
 	llist_add(&page->pcp_llist, &zone->trylock_free_pages);
 }
@@ -1549,7 +1549,7 @@ static void free_one_page(struct zone *zone, struct page *page,
 
 		llnode = llist_del_all(llhead);
 		llist_for_each_entry_safe(p, tmp, llnode, pcp_llist) {
-			unsigned int p_order = p->order;
+			unsigned int p_order = p->private;
 
 			split_large_buddy(zone, p, page_to_pfn(p), p_order, fpi_flags);
 			__count_vm_events(PGFREE, 1 << p_order);
-- 
2.47.2



  parent reply	other threads:[~2025-09-10 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 14:29 [PATCH 0/3] Small cleanups Matthew Wilcox (Oracle)
2025-09-10 14:29 ` [PATCH 1/3] mm: Constify compound_order() and page_size() Matthew Wilcox (Oracle)
2025-09-10 14:42   ` Vlastimil Babka
2025-09-10 14:29 ` [PATCH 2/3] mm: Remove redundant test in validate_page_before_insert() Matthew Wilcox (Oracle)
2025-09-10 14:42   ` Vlastimil Babka
2025-09-10 14:29 ` Matthew Wilcox (Oracle) [this message]
2025-09-10 14:50   ` [PATCH 3/3] mm: Remove page->order Vlastimil Babka
2025-09-10 20:03   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250910142923.2465470-4-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ast@kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox