]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: do not drain pagevecs for mlockall(MCL_FUTURE)
authorChristoph Lameter <cl@gentwo.org>
Mon, 24 Oct 2011 14:54:33 +0000 (01:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Oct 2011 09:07:52 +0000 (20:07 +1100)
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 <cl@gentwo.org>
Cc: David Rientjes <rientjes@google.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Acked-by: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mlock.c

index 4e185e0f21c89d54528e30b5ac3196e63c13af36..70d2b988c1265cc53846475fae5520824ea3f46b 100644 (file)
@@ -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(&current->mm->mmap_sem);