mbox series

[v2,00/10] mm/thp: fix THP splitting unmap BUGs and related (fwd)

Message ID f7fc2e72-b8b1-f132-cdb2-1b256a6f2de@google.com (mailing list archive)
Headers show
Series mm/thp: fix THP splitting unmap BUGs and related (fwd) | expand


Hugh Dickins June 9, 2021, 4:11 a.m. UTC
---------- Forwarded message ----------
Date: Tue, 8 Jun 2021 20:57:34 -0700 (PDT)
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>,
    Kirill A. Shutemov <kirill.shutemov@linux.intel.com>,
    Yang Shi <shy828301@gmail.com>, Wang Yugui <wangyugui@e16-tech.com>,
    Matthew Wilcox <willy@infradead.org>,
    Naoya Horiguchi <naoya.horiguchi@nec.com>,
    Alistair Popple <apopple@nvidia.com>, Ralph Campbell <rcampbell@nvidia.com>,
    Zi Yan <ziy@nvidia.com>, Miaohe Lin <linmiaohe@huawei.com>,
    Minchan Kim <minchan@kernel.org>, Jue Wang <juew@google.com>,
    Peter Xu <peterx@redhat.com>, Jan Kara <jack@suse.cz>,
    Shakeel Butt <shakeelb@google.com>, Oscar Salvador <osalvador@suse.de>
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

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:

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

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(-)