linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* a race condition in SMP TLB flushing code?
@ 2003-02-08  1:02 Jun Sun
  0 siblings, 0 replies; only message in thread
From: Jun Sun @ 2003-02-08  1:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: jsun

We were chasing a bug in MIPS/SMP TLB part, and noticed that
i386 may have a race condition in the same area.

Here is the scenario how it may happen:

cpu A:
        call flush_tlb_mm()
        find out cpu_vm_mask set for cpu B (cpu_mask != 0)

cpu B:
        inside schedule(), calling switch_mm()
        clear cpu_vm_mask bit for current mm, trying
        stop ipi for flushing tlb

cpu A:
        oops, but it is a little too late.  already
        checked cpu_vm_mask, and send an ipi to cpu B for
        flushing tlb anyway.

cpu B:
        get the ipi and (WITHOUT CHECKING cpu_vm_mask again)
        go ahead doing tlb flushing.

I am not sure if any disastrous result will happen, but apparently
an unintended flush has happened.  In MIPS such a hole could
cause two processes using the same TLB entries which yields all kinds
of interesting crashes.

BTW, I am looking at the 2.4.19 kernel.  Please cc your reply to my
email address.  Thanks.

Jun

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

only message in thread, other threads:[~2003-02-08  0:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-08  1:02 a race condition in SMP TLB flushing code? Jun Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).