Commit 3e124416 authored by Andrew Morton's avatar Andrew Morton Committed by Jens Axboe

[PATCH] flush_tlb_all is not preempt safe

Patch from: Zwane Mwaikambo <zwane@holomorphy.com>

Considering that smp_call_function isn't allowed to hold a lock reference and
within smp_call_function we lock and unlock call_lock thus triggering a
preempt point.  Therefore we can't guarantee that we'll be on the same
processor when we hit do_flush_tlb_all_local.

void flush_tlb_all(void)
{
	smp_call_function (flush_tlb_all_ipi,0,1,1);

	do_flush_tlb_all_local();
}

...

smp_call_function()
{
	spin_lock(call_lock);
	...
	spin_unlock(call_lock);
	<preemption point>
}

...

do_flush_tlb_all_local() - possibly not executing on same processor
anymore.
parent ea609f54
......@@ -452,9 +452,11 @@ static void flush_tlb_all_ipi(void* info)
void flush_tlb_all(void)
{
preempt_disable();
smp_call_function (flush_tlb_all_ipi,0,1,1);
do_flush_tlb_all_local();
preempt_enable();
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment