From: Vlastimil Babka <vbabka@suse.cz>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Alexei Starovoitov <ast@kernel.org>
Subject: Re: [PATCH 3/3] mm: Remove page->order
Date: Wed, 10 Sep 2025 16:50:27 +0200 [thread overview]
Message-ID: <fb3ed48f-af19-4f5c-b807-9602167b6972@suse.cz> (raw)
In-Reply-To: <20250910142923.2465470-4-willy@infradead.org>
On 9/10/25 16:29, Matthew Wilcox (Oracle) wrote:
> 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>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Nit below:
> ---
> 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.
In fact pcp_list too, so "or on pcp_list or 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);
next prev parent reply other threads:[~2025-09-10 14:50 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 ` [PATCH 3/3] mm: Remove page->order Matthew Wilcox (Oracle)
2025-09-10 14:50 ` Vlastimil Babka [this message]
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=fb3ed48f-af19-4f5c-b807-9602167b6972@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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