Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
9d003dec 6fd893a4

+5 -7
+3 -5
include/linux/mm_types.h
··· 97 97 /* Or, free page */ 98 98 struct list_head buddy_list; 99 99 struct list_head pcp_list; 100 - struct { 101 - struct llist_node pcp_llist; 102 - unsigned int order; 103 - }; 100 + struct llist_node pcp_llist; 104 101 }; 105 102 struct address_space *mapping; 106 103 union { ··· 108 111 * @private: Mapping-private opaque data. 109 112 * Usually used for buffer_heads if PagePrivate. 110 113 * Used for swp_entry_t if swapcache flag set. 111 - * Indicates order in the buddy system if PageBuddy. 114 + * Indicates order in the buddy system if PageBuddy 115 + * or on pcp_llist. 112 116 */ 113 117 unsigned long private; 114 118 };
+2 -2
mm/page_alloc.c
··· 1520 1520 unsigned int order) 1521 1521 { 1522 1522 /* Remember the order */ 1523 - page->order = order; 1523 + page->private = order; 1524 1524 /* Add the page to the free list */ 1525 1525 llist_add(&page->pcp_llist, &zone->trylock_free_pages); 1526 1526 } ··· 1549 1549 1550 1550 llnode = llist_del_all(llhead); 1551 1551 llist_for_each_entry_safe(p, tmp, llnode, pcp_llist) { 1552 - unsigned int p_order = p->order; 1552 + unsigned int p_order = p->private; 1553 1553 1554 1554 split_large_buddy(zone, p, page_to_pfn(p), p_order, fpi_flags); 1555 1555 __count_vm_events(PGFREE, 1 << p_order);