Orabug:
25379970
Saves time when smp_flush_tlb_page/smp_flush_tlb_pending
is called during do_exit(...). Without this patch, killing
processes had performance bottle neck in these functions
due to unnecessary xcalls made to flush TLBs.
Reviewed-by: Nitin Gupta <nitin.m.gupta@oracle.com>
Signed-off-by: Bob Picco <bob.picco@oracle.com
Signed-off-by: Henry Willard <henry.willard@oracle.com>
Signed-off-by: Sanath Kumar <sanath.s.kumar@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
info.nr = nr;
info.vaddrs = vaddrs;
+ if (atomic_read(&mm->mm_users) < 1)
+ goto done;
+
if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
else
&info, 1);
__flush_tlb_pending(ctx, nr, vaddrs);
-
+done:
put_cpu();
}
unsigned long context = CTX_HWBITS(mm->context);
int cpu = get_cpu();
+ if (atomic_read(&mm->mm_users) < 1)
+ goto done;
+
if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
else
context, vaddr, 0,
mm_cpumask(mm));
__flush_tlb_page(context, vaddr);
-
+done:
put_cpu();
}