All of lore.kernel.org
 help / color / mirror / Atom feed
* x86_64 remote tlb invalidation
@ 2009-05-06  3:01 Michel Lespinasse
  0 siblings, 0 replies; only message in thread
From: Michel Lespinasse @ 2009-05-06  3:01 UTC (permalink / raw)
  To: linux-mm

Reading through arch/x86/kernel/tlb_64.c, I've been wondering why
the code for native_flush_tlb_others() can't be simplified as follows:

--- linux-2.6.29.2.orig/arch/x86/kernel/tlb_64.c	2009-04-27 10:37:11.000000000 -0700
+++ linux-2.6.29.2/arch/x86/kernel/tlb_64.c	2009-05-05 16:53:07.770085000 -0700
@@ -180,7 +180,7 @@
 
 	f->flush_mm = mm;
 	f->flush_va = va;
-	cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask);
+	f->flush_cpumask = cpumask;
 
 	/*
 	 * Make the above memory operations globally visible before


My reasoning:

* The previous invocation of native_flush_tlb_others() waited for
  f->flush_cpumask to be cleared before it unlocked f->tlbstate_lock;

* sets bits in the flush_cpumask field of union smp_flush_state without
  holding the correwsponding tlbstate_lock;

* Therefore, f->flush_cpumask must still be cleared when the next invocation
  of native_flush_tlb_others() reacquires f->tlbstate_lock.

I don't think I missed anything, did I ?

Thanks,

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-06  3:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-06  3:01 x86_64 remote tlb invalidation Michel Lespinasse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.