]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/rmap: cleanup partially-mapped handling in __folio_remove_rmap()
authorDavid Hildenbrand <david@redhat.com>
Wed, 10 Jul 2024 21:43:50 +0000 (23:43 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:44 +0000 (17:52 -0700)
commit9966bbf0edc630b6f8d185979b783ebfb2361b54
tree95fa7aca2ad013a1e0d8d64fdcd14d9a0d9370fc
parent0f254f22fcfebb257c4cfed0504086ba6e9410f0
mm/rmap: cleanup partially-mapped handling in __folio_remove_rmap()

Let's simplify and reduce code indentation.  In the RMAP_LEVEL_PTE case,
we already check for nr when computing partially_mapped.

For RMAP_LEVEL_PMD, it's a bit more confusing.  Likely, we don't need the
"nr" check, but we could have "nr < nr_pmdmapped" also if we stumbled into
the "/* Raced ahead of another remove and an add?  */" case.  So let's
simply move the nr check in there.

Note that partially_mapped is always false for small folios.

No functional change intended.

Link: https://lkml.kernel.org/r/20240710214350.147864-1-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/rmap.c