[PATCH v2 0/3] Fix cache flush issues considering PMD sharing

From: Baolin Wang
Date: Wed Apr 27 2022 - 07:02:37 EST


Hi,

This patch set fixes some cache flushing issues if PMD sharing is
possible for hugetlb pages, which were found by code inspection.
Meanwhile Mike found the flush_cache_page() can not cover the whole
size of a hugetlb page on some architectures [1], so I added a new
patch 3 to fix this issue, since I found only try_to_unmap_one()
and try_to_migrate_one() need to fix after some investigation.

Please help to review. Thanks.

[1] https://lore.kernel.org/linux-mm/064da3bb-5b4b-7332-a722-c5a541128705@xxxxxxxxxx/

Changes from v1:
- Add reviewed-by tag from Mike.
- Update some comments suggested by Mike.
- Add a new patch to fix cache issue for hugetlb page.

Baolin Wang (3):
mm: hugetlb: Considering PMD sharing when flushing cache/TLBs
mm: rmap: Move the cache flushing to the correct place for hugetlb PMD
sharing
mm: rmap: Use flush_cache_range() to flush cache for hugetlb pages

mm/hugetlb.c | 17 ++++++++-
mm/mremap.c | 2 +-
mm/rmap.c | 118 ++++++++++++++++++++++++++++++++---------------------------
3 files changed, 80 insertions(+), 57 deletions(-)

--
1.8.3.1