Skip to content

RFC mm/madvise: support process_madvise(MADV_DONTNEED)

Nadav Amit linux-mm lkml 1 version NAK

Status from this message: NAK.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 34 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/8mm/madvise: propagate vma->vm_end changesmm/madvise.c+8 -46 replies
2/8mm/madvise: remove unnecessary check on madvise_dontneed_free()mm/madvise.c+1 -34 replies
3/8mm/madvise: remove unnecessary checks on madvise_free_single_vma()mm/madvise.c+1 -72 replies
4/8mm/madvise: define madvise behavior in a structmm/madvise.c+109 -594 replies
5/8mm/madvise: perform certain operations once on process_madvise()mm/madvise.c+86 -530 replies
6/8mm/madvise: more aggressive TLB batchingmm/internal.h mm/madvise.c mm/memory.c+67 -440 replies
7/8mm/madvise: deduplicate code in madvise_dontneed_free()mm/madvise.c+15 -250 replies
8/8mm/madvise: process_madvise(MADV_DONTNEED)mm/madvise.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/8] mm/madvise: support process_madvise(MADV_DONTNEED)

From: Nadav Amit <[email protected]>

The goal of these patches is to add support for process_madvise(MADV_DONTNEED). Yet, in the process some (arguably) useful cleanups, a bug fix and performance enhancements are performed.

The patches try to consolidate the logic across different behaviors, and to a certain extent overlap/conflict with an outstanding patch that does something similar [1]. This consolidation however is mostly orthogonal to the aforementioned one and done in order to clarify what is done in respect to locks and TLB for each behavior and to batch these operations more efficiently on process_madvise().

process_madvise(MADV_DONTNEED) is useful for two reasons: (a) it allows userfaultfd monitors to unmap memory from monitored processes; and (b) it is more efficient than madvise() since it is vectored and batches TLB flushes more aggressively.

The first three patches should not interfere with the outstanding patch [1]. The rest might need to be rebased after [1] is applied.

[1] https://lore.kernel.org/linux-mm/CAJuCfpFDBJ_W1y2tqAT4BGtPbWrjjDud_JuKO8ZbnjYfeVNvRg@mail.gmail.com/

Cc Peter Xu <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Colin Cross <[email protected]>
Cc Suren Baghdasarya <[email protected]>
Cc Mike Rapoport <[email protected]>

Nadav Amit (8):
mm/madvise: propagate vma->vm_end changes
mm/madvise: remove unnecessary check on madvise_dontneed_free() mm/madvise: remove unnecessary checks on madvise_free_single_vma() mm/madvise: define madvise behavior in a struct mm/madvise: perform certain operations once on process_madvise() mm/madvise: more aggressive TLB batching
mm/madvise: deduplicate code in madvise_dontneed_free() mm/madvise: process_madvise(MADV_DONTNEED)

 mm/internal.h |   5 +
 mm/madvise.c  | 396 ++++++++++++++++++++++++++++++--------------------
 mm/memory.c   |   2 +-
 3 files changed, 248 insertions(+), 155 deletions(-)
Signature · 1 line
2.25.1