Linux-man Archive on
 help / color / Atom feed
* [alternative-merged] mm-madvise-employ-mmget_still_valid-for-write-lock.patch removed from -mm tree
@ 2020-04-25 22:58 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-04-25 22:58 UTC (permalink / raw)
  To: alexander.h.duyck, axboe, bgeffon, christian, dancol, hannes,
	jannh, joaodias, joel, ktkhai, linux-man, mhocko, minchan,
	mm-commits, oleksandr, shakeelb, sj38.park, sjpark, sonnyrao,
	sspatil, surenb, timmurray, vbabka

The patch titled
     Subject: mm/madvise: employ mmget_still_valid() for write lock
has been removed from the -mm tree.  Its filename was

This patch was dropped because an alternative patch was merged

From: Oleksandr Natalenko <>
Subject: mm/madvise: employ mmget_still_valid() for write lock

Do the very same trick as we already do since 04f5866e41fb.  KSM hints
will require locking mmap_sem for write since they modify vm_flags, so for
remote KSM hinting this additional check is needed.

Signed-off-by: Oleksandr Natalenko <>
Signed-off-by: Minchan Kim <>
Reviewed-by: Suren Baghdasaryan <>
Cc: Alexander Duyck <>
Cc: Brian Geffon <>
Cc: Christian Brauner <>
Cc: Daniel Colascione <>
Cc: Jann Horn <>
Cc: Jens Axboe <>
Cc: Joel Fernandes <>
Cc: Johannes Weiner <>
Cc: John Dias <>
Cc: Kirill Tkhai <>
Cc: Michal Hocko <>
Cc: Sandeep Patil <>
Cc: SeongJae Park <>
Cc: SeongJae Park <>
Cc: Shakeel Butt <>
Cc: Sonny Rao <>
Cc: Tim Murray <>
Cc: Vlastimil Babka <>
Cc: <>
Signed-off-by: Andrew Morton <>

 mm/madvise.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/mm/madvise.c~mm-madvise-employ-mmget_still_valid-for-write-lock
+++ a/mm/madvise.c
@@ -1124,6 +1124,8 @@ int do_madvise(struct task_struct *targe
 	if (write) {
 		if (down_write_killable(&mm->mmap_sem))
 			return -EINTR;
+		if (current->mm != mm && !mmget_still_valid(mm))
+			goto skip_mm;
 	} else {
@@ -1175,6 +1177,7 @@ int do_madvise(struct task_struct *targe
 	if (write)

Patches currently in -mm which might be from are


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 22:58 [alternative-merged] mm-madvise-employ-mmget_still_valid-for-write-lock.patch removed from -mm tree akpm

Linux-man Archive on

Archives are clonable:
	git clone --mirror linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ \
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone