summaryrefslogtreecommitdiffstats
path: root/mm/vmacache.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmacache.c')
-rw-r--r--mm/vmacache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/vmacache.c b/mm/vmacache.c
index 658ed3b3e38d..9f25af825dec 100644
--- a/mm/vmacache.c
+++ b/mm/vmacache.c
@@ -17,6 +17,16 @@ void vmacache_flush_all(struct mm_struct *mm)
{
struct task_struct *g, *p;
+ /*
+ * Single threaded tasks need not iterate the entire
+ * list of process. We can avoid the flushing as well
+ * since the mm's seqnum was increased and don't have
+ * to worry about other threads' seqnum. Current's
+ * flush will occur upon the next lookup.
+ */
+ if (atomic_read(&mm->mm_users) == 1)
+ return;
+
rcu_read_lock();
for_each_process_thread(g, p) {
/*