2021-06-09 12:43:18

by Hugh Dickins

[permalink] [raw]
Subject: [PATCH v2 00/10] mm/thp: fix THP splitting unmap BUGs and related (fwd)



---------- Forwarded message ----------
Date: Tue, 8 Jun 2021 20:57:34 -0700 (PDT)
From: Hugh Dickins <[email protected]>
To: Andrew Morton <[email protected]>
Cc: Hugh Dickins <[email protected]>,
Kirill A. Shutemov <[email protected]>,
Yang Shi <[email protected]>, Wang Yugui <[email protected]>,
Matthew Wilcox <[email protected]>,
Naoya Horiguchi <[email protected]>,
Alistair Popple <[email protected]>, Ralph Campbell <[email protected]>,
Zi Yan <[email protected]>, Miaohe Lin <[email protected]>,
Minchan Kim <[email protected]>, Jue Wang <[email protected]>,
Peter Xu <[email protected]>, Jan Kara <[email protected]>,
Shakeel Butt <[email protected]>, Oscar Salvador <[email protected]>
Subject: [PATCH v2 00/10] mm/thp: fix THP splitting unmap BUGs and related

Here is v2 batch of long-standing THP bug fixes that I had not got
around to sending before, but prompted now by Wang Yugui's report
https://lore.kernel.org/linux-mm/[email protected]/

Wang Yugui has tested a rollup of these fixes applied to 5.10.39,
and they have done no harm, but have *not* fixed that issue:
something more is needed and I have no idea of what.

But at least these clear up related issues, and should go to stable
(except for the last three). Some of these are fully reviewed and
tags added, others have been waiting on this v2 respin.

For now I've left out the bigger page_vma_mapped_walk() one (was 5/7):
I'm still working on splitting that up for Kirill's review, better get
the rest out before completing and posting that as a separate series.

2/10 here replaces part of 1/7 before; 7/10 and 8/10 from Yang Shi
inserted; 10/10 added to apply TTU_SYNC in mm/memory-failure.c.

These are against 5.13-rc5: expect mmotm conflicts with a couple of
Alistair Popple's "Add support for SVM atomics in Nouveau" series:
mm-remove-special-swap-entry-functions.patch
mm-rmap-split-try_to_munlock-from-try_to_unmap.patch

Suggested adjustments to Alistair's sent June 3rd, but I've not
rechecked (a couple of changes since v1 should reduce the damage
slightly).

01/10 mm/thp: fix __split_huge_pmd_locked() on shmem migration entry
02/10 mm/thp: make is_huge_zero_pmd() safe and quicker
03/10 mm/thp: try_to_unmap() use TTU_SYNC for safe splitting
04/10 mm/thp: fix vma_address() if virtual address below file offset
05/10 mm/thp: fix page_address_in_vma() on file THP tails
06/10 mm/thp: unmap_mapping_page() to fix THP truncate_cleanup_page()
07/10 mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split
08/10 mm: rmap: make try_to_unmap() void function
09/10 mm/thp: remap_page() is only needed on anonymous THP
10/10 mm: hwpoison_user_mappings() try_to_unmap() with TTU_SYNC

include/linux/huge_mm.h | 8 ++++-
include/linux/mm.h | 3 ++
include/linux/rmap.h | 3 +-
mm/huge_memory.c | 61 +++++++++++++++++++++++-------------------
mm/internal.h | 51 ++++++++++++++++++++++++++---------
mm/memory-failure.c | 17 +++++------
mm/memory.c | 40 +++++++++++++++++++++++++++
mm/page_vma_mapped.c | 27 +++++++++++-------
mm/pgtable-generic.c | 5 +--
mm/rmap.c | 38 +++++++++++++++-----------
mm/truncate.c | 43 +++++++++++++----------------
mm/vmscan.c | 3 +-
12 files changed, 195 insertions(+), 104 deletions(-)

Hugh