summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mlock.c3
1 files changed, 2 insertions, 1 deletions
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(&current->mm->mmap_sem);