Files
linux/include/linux
Suren Baghdasaryan 55fd6fccad mm/khugepaged: write-lock VMA while collapsing a huge page
Protect VMA from concurrent page fault handler while collapsing a huge
page.  Page fault handler needs a stable PMD to use PTL and relies on
per-VMA lock to prevent concurrent PMD changes.  pmdp_collapse_flush(),
set_huge_pmd() and collapse_and_free_pmd() can modify a PMD, which will
not be detected by a page fault handler without proper locking.

Before this patch, page tables can be walked under any one of the
mmap_lock, the mapping lock, and the anon_vma lock; so when khugepaged
unlinks and frees page tables, it must ensure that all of those either are
locked or don't exist.  This patch adds a fourth lock under which page
tables can be traversed, and so khugepaged must also lock out that one.

[surenb@google.com: vm_lock/i_mmap_rwsem inversion in retract_page_tables]
  Link: https://lkml.kernel.org/r/20230303213250.3555716-1-surenb@google.com
[surenb@google.com: build fix]
  Link: https://lkml.kernel.org/r/CAJuCfpFjWhtzRE1X=J+_JjgJzNKhq-=JT8yTBSTHthwp0pqWZw@mail.gmail.com
Link: https://lkml.kernel.org/r/20230227173632.3292573-16-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-04-05 20:02:58 -07:00
..
2023-01-16 09:26:05 +01:00
2022-11-04 12:59:25 +02:00
2023-02-16 13:42:22 +01:00
2023-02-20 09:20:55 -05:00
2023-02-15 19:38:50 +01:00
2023-01-19 14:46:25 +01:00
2022-12-07 09:43:12 -07:00
2023-02-03 08:20:55 -07:00
2023-01-13 11:48:15 +01:00
2023-03-05 10:49:37 -08:00
2023-01-19 16:07:40 +01:00
2023-01-29 15:18:33 -07:00
2023-01-29 15:18:33 -07:00
2023-02-06 19:06:58 +01:00
2023-01-19 09:24:28 +01:00
2023-03-13 10:14:05 +01:00
2023-01-11 06:52:43 -05:00
2023-03-19 10:02:04 -07:00
2022-11-11 18:18:05 -08:00
2022-11-15 00:42:02 -08:00
2022-12-11 19:30:20 -08:00
2023-02-13 10:11:20 +02:00
2023-01-19 09:24:28 +01:00
2023-01-19 09:24:28 +01:00
2023-01-19 09:24:30 +01:00
2023-03-15 14:58:52 +01:00
2023-01-16 09:26:06 +01:00
2023-02-23 13:43:23 +01:00
2023-01-04 14:44:13 -07:00
2023-01-19 09:24:28 +01:00
2022-12-20 03:13:45 +01:00
2022-10-23 18:06:54 -04:00
2023-01-19 09:24:28 +01:00
2023-01-19 15:01:19 +01:00
2023-01-03 17:49:22 -08:00
2023-01-18 17:12:47 -08:00
2023-02-16 18:10:18 +01:00
2023-01-23 15:38:08 +01:00
2023-02-20 19:26:58 -05:00
2023-01-19 09:24:28 +01:00
2022-10-24 12:12:32 -07:00