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.

huge_memory: convert unmap_page() to unmap_folio()

Remove a folio->page->folio conversion.

Link: https://lkml.kernel.org/r/20220902194653.1739778-54-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
684555aa 3e9a13da

+6 -7
+6 -7
mm/huge_memory.c
··· 2355 2355 } 2356 2356 } 2357 2357 2358 - static void unmap_page(struct page *page) 2358 + static void unmap_folio(struct folio *folio) 2359 2359 { 2360 - struct folio *folio = page_folio(page); 2361 2360 enum ttu_flags ttu_flags = TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD | 2362 2361 TTU_SYNC; 2363 2362 2364 - VM_BUG_ON_PAGE(!PageHead(page), page); 2363 + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); 2365 2364 2366 2365 /* 2367 2366 * Anon pages need migration entries to preserve them, but file ··· 2377 2378 { 2378 2379 int i = 0; 2379 2380 2380 - /* If unmap_page() uses try_to_migrate() on file, remove this check */ 2381 + /* If unmap_folio() uses try_to_migrate() on file, remove this check */ 2381 2382 if (!folio_test_anon(folio)) 2382 2383 return; 2383 2384 for (;;) { ··· 2427 2428 * for example lock_page() which set PG_waiters. 2428 2429 * 2429 2430 * Note that for mapped sub-pages of an anonymous THP, 2430 - * PG_anon_exclusive has been cleared in unmap_page() and is stored in 2431 + * PG_anon_exclusive has been cleared in unmap_folio() and is stored in 2431 2432 * the migration entry instead from where remap_page() will restore it. 2432 2433 * We can still have PG_anon_exclusive set on effectively unmapped and 2433 2434 * unreferenced sub-pages of an anonymous THP: we can simply drop ··· 2699 2700 } 2700 2701 2701 2702 /* 2702 - * Racy check if we can split the page, before unmap_page() will 2703 + * Racy check if we can split the page, before unmap_folio() will 2703 2704 * split PMDs 2704 2705 */ 2705 2706 if (!can_split_folio(folio, &extra_pins)) { ··· 2707 2708 goto out_unlock; 2708 2709 } 2709 2710 2710 - unmap_page(&folio->page); 2711 + unmap_folio(folio); 2711 2712 2712 2713 /* block interrupt reentry in xa_lock and spinlock */ 2713 2714 local_irq_disable();