From: Hugh Dickins Date: Sat, 6 Jul 2024 21:29:00 +0000 (-0700) Subject: mm: simplify folio_migrate_mapping() X-Git-Tag: v6.11-rc1~85^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5ea521250afdf3d70c72970660f44aebf56ea19;p=thirdparty%2Flinux.git mm: simplify folio_migrate_mapping() Now that folio_undo_large_rmappable() is an inline function checking order and large_rmappable for itself (and __folio_undo_large_rmappable() is now declared even when CONFIG_TRANASPARENT_HUGEPAGE is off) there is no need for folio_migrate_mapping() to check large and large_rmappable first (in the mapping case when it has had to freeze anyway). Link: https://lkml.kernel.org/r/68feee73-050e-8e98-7a3a-abf78738d92c@google.com Signed-off-by: Hugh Dickins Reviewed-by: Zi Yan Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Nhat Pham Cc: Yang Shi Signed-off-by: Andrew Morton --- diff --git a/mm/migrate.c b/mm/migrate.c index ff512c43fecb8..6eb9df239230c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -438,8 +438,7 @@ static int __folio_migrate_mapping(struct address_space *mapping, } /* Take off deferred split queue while frozen and memcg set */ - if (folio_test_large(folio) && folio_test_large_rmappable(folio)) - folio_undo_large_rmappable(folio); + folio_undo_large_rmappable(folio); /* * Now we know that no one else is looking at the folio: