]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/huge_memory: fix outdated comment about freeing subpages in __folio_split
authorBarry Song (Xiaomi) <baohua@kernel.org>
Thu, 23 Apr 2026 03:49:17 +0000 (11:49 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:04:39 +0000 (21:04 -0700)
The comment appears to be outdated.  add_to_swap() no longer exists,
and the explanation of why we need to call put_page() after splitting
could be made more general.

Link: https://lore.kernel.org/20260423034917.8234-1-baohua@kernel.org
Signed-off-by: Barry Song (Xiaomi) <baohua@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Youngjun Park <youngjun.park@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index 970e077019b75a4ad140c6ac16d993544fc85298..4586f3ccb1336d6b092cab1b5214344aa66fab0a 100644 (file)
@@ -4190,11 +4190,10 @@ fail:
 
                folio_unlock(new_folio);
                /*
-                * Subpages may be freed if there wasn't any mapping
-                * like if add_to_swap() is running on a lru page that
-                * had its mapping zapped. And freeing these pages
-                * requires taking the lru_lock so we do the put_page
-                * of the tail pages after the split is complete.
+                * Subpages whose mapping has been zapped may be freed
+                * earlier, but freeing them requires taking the
+                * lru_lock, so we defer put_page() on tail pages until
+                * after the split completes.
                 */
                free_folio_and_swap_cache(new_folio);
        }