mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.5] flush_tlb_all is not preempt safe.
@ 2003-02-14 11:06 Zwane Mwaikambo
  2003-02-14 11:13 ` Zwane Mwaikambo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zwane Mwaikambo @ 2003-02-14 11:06 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds

Hi,
	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)
{
	preempt_disable();
	smp_call_function (flush_tlb_all_ipi,0,1,1);

	do_flush_tlb_all_local();
	preempt_enable();
}

...

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.

This case is fixed in my smp_call_function_on_cpu patches by not allowing 
smp_call_function to invoke preemption.

Index: linux-2.5.60-uml/arch/i386/kernel/smp.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.60/arch/i386/kernel/smp.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 smp.c
--- linux-2.5.60-uml/arch/i386/kernel/smp.c	10 Feb 2003 22:14:16 -0000	1.1.1.1
+++ linux-2.5.60-uml/arch/i386/kernel/smp.c	14 Feb 2003 10:59:19 -0000
@@ -452,9 +452,11 @@
 
 void flush_tlb_all(void)
 {
+	preempt_disable();
 	smp_call_function (flush_tlb_all_ipi,0,1,1);
 
 	do_flush_tlb_all_local();
+	preempt_enable();
 }
 
 /*

-- 
function.linuxpower.ca

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-20 19:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-14 11:06 [PATCH][2.5] flush_tlb_all is not preempt safe Zwane Mwaikambo
2003-02-14 11:13 ` Zwane Mwaikambo
2003-02-15 13:41   ` Zwane Mwaikambo
2003-02-19 20:23 ` Thomas Schlichter
2003-02-20 10:55 ` [PATCH][2.5] flush_tlb_all is not preempt safe in x86_64 and i386/mach-voyager Thomas Schlichter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®