On 2022/8/10 1:18, Matthew Wilcox (Oracle) wrote: > In preparation for allocating frozen pages, stop initialising > the page refcount in post_alloc_hook(). > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Looks good to me. Thanks. Reviewed-by: Miaohe Lin <linmiaohe@xxxxxxxxxx> > --- > mm/compaction.c | 1 + > mm/page_alloc.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 640fa76228dd..63dc6abdb573 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -97,6 +97,7 @@ static void split_map_pages(struct list_head *list) > nr_pages = 1 << order; > > post_alloc_hook(page, order, __GFP_MOVABLE); > + set_page_refcounted(page); > if (order) > split_page(page, order); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 30e7a5974d39..d41b8c8f3135 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2465,7 +2465,6 @@ inline void post_alloc_hook(struct page *page, unsigned int order, > int i; > > set_page_private(page, 0); > - set_page_refcounted(page); > > arch_alloc_page(page, order); > debug_pagealloc_map_pages(page, 1 << order); > @@ -2536,6 +2535,7 @@ static void prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags > set_page_pfmemalloc(page); > else > clear_page_pfmemalloc(page); > + set_page_refcounted(page); > } > > /* >