mm: rmap: use flush_cache_range() to flush cache for hugetlb pages
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Tue, 10 May 2022 01:20:53 +0000 (18:20 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 13 May 2022 14:20:07 +0000 (07:20 -0700)
commitdfc7ab57560da385f705b28e2bf50e3b90444a6b
treeb485b1d51b79da9e517ff06c36a49b8259c250b4
parent54205e9c5425049aef1bc7a812f890f00b5f79c7
mm: rmap: use flush_cache_range() to flush cache for hugetlb pages

Now we will use flush_cache_page() to flush cache for anonymous hugetlb
pages when unmapping or migrating a hugetlb page mapping, but the
flush_cache_page() only handles a PAGE_SIZE range on some architectures
(like arm32, arc and so on), which will cause potential cache issues.
Thus change to use flush_cache_range() to cover the whole size of a
hugetlb page.

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