diff mbox series

[RFC,8/8] mm/madvise: process_madvise(MADV_DONTNEED)

Message ID 20210926161259.238054-9-namit@vmware.com (mailing list archive)
State New
Headers show
Series mm/madvise: support process_madvise(MADV_DONTNEED) | expand

Commit Message

Nadav Amit Sept. 26, 2021, 4:12 p.m. UTC
From: Nadav Amit <namit@vmware.com>

Userfaultfd users, for the sake of memory management, debugging or other
types of monitoring may wish to use process_madvise(MADV_DONTNEED).

Moreover, since process_madvise() supports vectored operations, and now
supports efficient TLB flushes, existing users of madvise(MADV_DONTNEED)
that wish to perform advices on non-contiguous memory may prefer
the vectored process_madvise() flavor for performance reasons.

Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Colin Cross <ccross@google.com>
Cc: Suren Baghdasarya <surenb@google.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
 mm/madvise.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/mm/madvise.c b/mm/madvise.c
index 9528c38fb6a4..d8f70960680e 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -81,6 +81,7 @@  static const struct madvise_info madvise_info[MADV_SOFT_OFFLINE+1] = {
 	},
 	[MADV_DONTNEED] = {
 		.behavior_valid = 1,
+		.process_behavior_valid = 1,
 		.need_mmap_read_only = 1,
 		.tlb_batching = 1,
 	},