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

Configure Feed

Select the types of activity you want to include in your feed.

mm/page_alloc: move set_page_refcounted() to callers of __alloc_pages_direct_reclaim()

In preparation for allocating frozen pages, stop initialising the page
refcount in __alloc_pages_direct_reclaim().

Link: https://lkml.kernel.org/r/20241125210149.2976098-11-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: William Kucharski <william.kucharski@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
30fdb6df 8e4c8a97

+3 -2
+3 -2
mm/page_alloc.c
··· 3964 3964 drained = true; 3965 3965 goto retry; 3966 3966 } 3967 - set_page_refcounted(page); 3968 3967 out: 3969 3968 psi_memstall_leave(&pflags); 3970 3969 ··· 4385 4386 /* Try direct reclaim and then allocating */ 4386 4387 page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac, 4387 4388 &did_some_progress); 4388 - if (page) 4389 + if (page) { 4390 + set_page_refcounted(page); 4389 4391 goto got_pg; 4392 + } 4390 4393 4391 4394 /* Try direct compaction and then allocating */ 4392 4395 page = __alloc_pages_direct_compact(gfp_mask, order, alloc_flags, ac,