summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-09-10 15:29:19 +0100
committerAndrew Morton <akpm@linux-foundation.org>2025-09-21 14:22:32 -0700
commit9d003dec972563efb8ce14c9962af3652d0e201d (patch)
tree4f311595582dd03f3f0345ab6ee46828513f368e
parent6fd893a40e3c990ea4ca3a9c084d1ddc3020d936 (diff)
mm: remove page->order
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. Link: https://lkml.kernel.org/r/20250910142923.2465470-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--include/linux/mm_types.h8
-rw-r--r--mm/page_alloc.c4
2 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index f048dc80646e..6920c816f6c6 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 cf38d499e045..2bfab96c207f 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);