mm/khugepaged: fixes for khugepaged+shmem
Status from this message: [merged mm-stable] mm-khugepaged-maintain-page-cache-uptodate-flag.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Changes in v6 from the cover letter
- Stop freezing the old pages so that we don't deadlock with mc_handle_file_pte and mincore.
- Add missing locking around shmem charge rollback.
- Rebase on mm-unstable (f01f73d64cb5). Beyond straightfoward conflicts, this involves adapting the fix for f520a742287e (i.e. an unhandled ENOMEM).
- Fix bug with bounds used with vma_interval_tree_foreach.
- Add a patch doing lru_add_drain after swapping in the shmem case.
- Update/clarify some comments.
- Drop ack on final patch
Patches in v6 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | mm/khugepaged: drain lru after swapping in shmemmm/ | +2 | 0 replies | Applied |
| 2/4 | mm/khugepaged: refactor collapse_file control flowmm/ | +113 | 0 replies | Applied |
| 3/4 | mm/khugepaged: skip shmem with userfaultfdinclude/ mm/ | +81 | 0 replies | Applied |
| 4/4 | mm/khugepaged: maintain page cache uptodate flagmm/ | +29 | 5 replies | Applied |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Peter Xu | Yang Shi | Hugh Dickins |
|---|---|---|---|
| 1/4 | |||
| 2/4 | A-b | R-b | A-b |
| 3/4 | A-b | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v6 0/4] mm/khugepaged: fixes for khugepaged+shmem
From: David Stevens <[email protected]>
This series reworks collapse_file so that the intermediate state of the collapse does not leak out of collapse_file. Although this makes collapse_file a bit more complicated, it means that the rest of the kernel doesn't have to deal with the unusual state. This directly fixes races with both lseek and mincore.
This series also fixes the fact that khugepaged completely breaks userfaultfd+shmem. The rework of collapse_file provides a convenient place to check for registered userfaultfds without making the shmem userfaultfd implementation care about khugepaged.
Finally, this series adds a lru_add_drain after swapping in shmem pages, which makes the subsequent folio_isolate_lru significantly more likely to succeed.
v5 -> v6:
- Stop freezing the old pages so that we don't deadlock with mc_handle_file_pte and mincore.
- Add missing locking around shmem charge rollback.
- Rebase on mm-unstable (f01f73d64cb5). Beyond straightfoward conflicts, this involves adapting the fix for f520a742287e (i.e. an unhandled ENOMEM).
- Fix bug with bounds used with vma_interval_tree_foreach.
- Add a patch doing lru_add_drain after swapping in the shmem case.
- Update/clarify some comments.
- Drop ack on final patch
v4 -> v5:
- Rebase on mm-unstable (9caa15b8a499)
- Gather acks
v3 -> v4:
- Base changes on mm-everything (fba720cb4dc0)
- Add patch to refactor error handling control flow in collapse_file
- Rebase userfaultfd patch with no significant logic changes
- Different approach for fixing lseek race
v2 -> v3:
- Use XA_RETRY_ENTRY to synchronize with reads from the page cache under the RCU read lock in userfaultfd fix
- Add patch to fix lseek race
v1 -> v2:
- Different approach for userfaultfd fix
*** BLURB HERE ***
David Stevens (4):
mm/khugepaged: drain lru after swapping in shmem mm/khugepaged: refactor collapse_file control flow mm/khugepaged: skip shmem with userfaultfd mm/khugepaged: maintain page cache uptodate flag
include/trace/events/huge_memory.h | 3 +- mm/khugepaged.c | 312 ++++++++++++++++------------- 2 files changed, 171 insertions(+), 144 deletions(-)
Signature · 1 line
2.40.0.348.gf938b09366-goog