]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: rmap: simplify the hugetlb handling when unmapping or migration
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Mon, 20 Jun 2022 11:47:15 +0000 (19:47 +0800)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Jul 2022 00:15:11 +0000 (20:15 -0400)
commit6400b77793a0c8de134eba0855eef11b19b775e0
tree5d5b7316a8fa08ac887572be0ff35897d235e554
parent84e55c1067bc577f63dd8be9ff7a66e612663b42
mm: rmap: simplify the hugetlb handling when unmapping or migration

According to previous discussion [1], there are so many levels of
indenting to handle the hugetlb case when unmapping or migration.  We can
combine folio_test_anon() and huge_pmd_unshare() to save one level of
indenting, by adding a local variable and moving the VM_BUG_ON() a little
forward.

No intended functional changes in this patch.

[1] https://lore.kernel.org/all/0b986dc4-5843-3e2d-c2df-5a2e9f13e6ab@oracle.com/

Link: https://lkml.kernel.org/r/28414b1b96f095e838c1e548074f8e0fc70d78cf.1655724713.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/rmap.c