[PATCH] mm/rmap: disable preemption for trace_tlb_flush()

Sergey Senozhatsky
2015-07-17T06:12:29Z

tlb_flush contains TP_CONDITION(cpu_online(smp_processor_id()))
which is better be executed with preemption disabled.

Move trace_tlb_flush(TLB_REMOTE_SHOOTDOWN) in try_to_unmap_flush()
under get_cpu().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
mm/rmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 30812e9..74086cc 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -613,9 +613,9 @@ void try_to_unmap_flush(void)
if (!tlb_ubc->flush_required)
return;

+ cpu = get_cpu();
trace_tlb_flush(TLB_REMOTE_SHOOTDOWN, -1UL);

- cpu = get_cpu();
if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask))
percpu_flush_tlb_batch_pages(&tlb_ubc->cpumask);

--
2.4.6