summaryrefslogtreecommitdiffstats
path: root/LICENSES/dual
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2022-05-12 20:22:53 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:10 -0700
commit999dad824c39ed14dee7c4412aae531ba9e74a90 (patch)
tree902b71da56121147d613e6ba249157ca5563e143 /LICENSES/dual
parent9c28a205c06123b9f0a0c4d819ece9f5f552d004 (diff)
downloadlinux-999dad824c39ed14dee7c4412aae531ba9e74a90.tar.gz
linux-999dad824c39ed14dee7c4412aae531ba9e74a90.tar.bz2
linux-999dad824c39ed14dee7c4412aae531ba9e74a90.zip
mm/shmem: persist uffd-wp bit across zapping for file-backed
File-backed memory is prone to being unmapped at any time. It means all information in the pte will be dropped, including the uffd-wp flag. To persist the uffd-wp flag, we'll use the pte markers. This patch teaches the zap code to understand uffd-wp and know when to keep or drop the uffd-wp bit. Add a new flag ZAP_FLAG_DROP_MARKER and set it in zap_details when we don't want to persist such an information, for example, when destroying the whole vma, or punching a hole in a shmem file. For the rest cases we should never drop the uffd-wp bit, or the wr-protect information will get lost. The new ZAP_FLAG_DROP_MARKER needs to be put into mm.h rather than memory.c because it'll be further referenced in hugetlb files later. Link: https://lkml.kernel.org/r/20220405014847.14295-1-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Axel Rasmussen <axelrasmussen@google.com> Cc: David Hildenbrand <david@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jerome Glisse <jglisse@redhat.com> Cc: "Kirill A . Shutemov" <kirill@shutemov.name> Cc: Matthew Wilcox <willy@infradead.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Nadav Amit <nadav.amit@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'LICENSES/dual')
0 files changed, 0 insertions, 0 deletions