Skip to content

Commit 585d2c5

Browse files
Kefeng Wangopsiff
authored andcommitted
mm: huge_memory: use more folio api in __split_huge_page_tail()
mainline inclusion from mainline-v6.8-rc1 category: performance Use more folio APIs to save six compound_head() calls in __split_huge_page_tail(). Link: https://lkml.kernel.org/r/20231110033324.2455523-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit b754276) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 38cff92 commit 585d2c5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

mm/huge_memory.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,13 +2478,13 @@ static void __split_huge_page_tail(struct folio *folio, int tail,
24782478
clear_compound_head(page_tail);
24792479

24802480
/* Finally unfreeze refcount. Additional reference from page cache. */
2481-
page_ref_unfreeze(page_tail, 1 + (!PageAnon(head) ||
2482-
PageSwapCache(head)));
2481+
page_ref_unfreeze(page_tail, 1 + (!folio_test_anon(folio) ||
2482+
folio_test_swapcache(folio)));
24832483

2484-
if (page_is_young(head))
2485-
set_page_young(page_tail);
2486-
if (page_is_idle(head))
2487-
set_page_idle(page_tail);
2484+
if (folio_test_young(folio))
2485+
folio_set_young(new_folio);
2486+
if (folio_test_idle(folio))
2487+
folio_set_idle(new_folio);
24882488

24892489
folio_xchg_last_cpupid(new_folio, folio_last_cpupid(folio));
24902490

0 commit comments

Comments
 (0)