[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210926161259.238054-1-namit@vmware.com>
Date: Sun, 26 Sep 2021 09:12:51 -0700
From: Nadav Amit <nadav.amit@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Peter Xu <peterx@...hat.com>, Nadav Amit <namit@...are.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Minchan Kim <minchan@...nel.org>,
Colin Cross <ccross@...gle.com>,
Suren Baghdasarya <surenb@...gle.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>
Subject: [RFC PATCH 0/8] mm/madvise: support process_madvise(MADV_DONTNEED)
From: Nadav Amit <namit@...are.com>
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 <peterx@...hat.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Minchan Kim <minchan@...nel.org>
Cc: Colin Cross <ccross@...gle.com>
Cc: Suren Baghdasarya <surenb@...gle.com>
Cc: Mike Rapoport <rppt@...ux.vnet.ibm.com>
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(-)
--
2.25.1
Powered by blists - more mailing lists