From: Christoph Lameter Date: Tue, 1 Nov 2011 00:09:35 +0000 (-0700) Subject: mm: do not drain pagevecs for mlockall(MCL_FUTURE) X-Git-Tag: firefly_0821_release~3680^2~4252^2~63 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=df9d6985be2a7e7683c46e4c6ea608fc69f02b45;p=firefly-linux-kernel-4.4.55.git mm: do not drain pagevecs for mlockall(MCL_FUTURE) MCL_FUTURE does not move pages between lru list and draining the LRU per cpu pagevecs is a nasty activity. Avoid doing it unecessarily. Signed-off-by: Christoph Lameter Cc: David Rientjes Reviewed-by: Minchan Kim Acked-by: KOSAKI Motohiro Cc: Mel Gorman Acked-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mlock.c b/mm/mlock.c index 048260c4e02e..7debb4fdf79b 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -549,7 +549,8 @@ SYSCALL_DEFINE1(mlockall, int, flags) if (!can_do_mlock()) goto out; - lru_add_drain_all(); /* flush pagevec */ + if (flags & MCL_CURRENT) + lru_add_drain_all(); /* flush pagevec */ down_write(¤t->mm->mmap_sem);