linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v0] mm/page_alloc: Cleanup for  __del_page_from_free_list()
@ 2025-09-25  8:50 zhongjinji
  2025-09-30 13:55 ` Vlastimil Babka
  0 siblings, 1 reply; 9+ messages in thread
From: zhongjinji @ 2025-09-25  8:50 UTC (permalink / raw)
  To: akpm
  Cc: vbabka, surenb, mhocko, jackmanb, hannes, ziy, linux-mm,
	linux-kernel, liulu.liu, feng.han, zhongjinji

It is unnecessary to set page->private in __del_page_from_free_list().

If the page is about to be allocated, page->private will be cleared by
post_alloc_hook() before the page is handed out. If the page is expanded
or merged, page->private will be reset by set_buddy_order, and no one
will retrieve the page's buddy_order without the PageBuddy flag being set.
If the page is isolated, it will also reset page->private when it
succeeds.

Since __del_page_from_free_list() is a hot path in the kernel, it would be
better to remove the unnecessary set_page_private().

Signed-off-by: zhongjinji <zhongjinji@honor.com>
---
 mm/page_alloc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d1d037f97c5f..1999eb7e7c14 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -868,7 +868,6 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
 
 	list_del(&page->buddy_list);
 	__ClearPageBuddy(page);
-	set_page_private(page, 0);
 	zone->free_area[order].nr_free--;
 
 	if (order >= pageblock_order && !is_migrate_isolate(migratetype))
-- 
2.17.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-10-20 19:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-25  8:50 [PATCH v0] mm/page_alloc: Cleanup for __del_page_from_free_list() zhongjinji
2025-09-30 13:55 ` Vlastimil Babka
2025-09-30 14:28   ` Zi Yan
2025-09-30 15:20     ` Vlastimil Babka
2025-09-30 15:28       ` Zi Yan
2025-10-01  4:38     ` jinji zhong
2025-10-03 15:18       ` Zi Yan
2025-10-20 15:06         ` jinji zhong
2025-10-20 19:55           ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox