[lkml]   [2011]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [BUG] "sched: Remove rq->lock from the first half of ttwu()" locks up on ARM
    On 29 May 2011 14:19, Russell King - ARM Linux <> wrote:
    > On Sun, May 29, 2011 at 01:01:58PM +0100, Catalin Marinas wrote:
    >> BTW, we currently have a per-cpu current_mm variable in context.c
    >> because switch_mm() is called before switch_to() and the CPU may
    >> receive an IPI to reset the ASID in this interval. But we can remove
    >> it entirely if we set the ASID in the post-switch hook and run the
    >> main switch code with interrupts disabled.
    > Unconvinced.  If we move the ASID update to the post-switch hook, then
    > we have the opposite problem - an IPI can sneak in between the dropping
    > of the IRQ disabling and the post-switch hook.  This could mean that
    > we end up racing to update the hardware ASID value instead (we may
    > have read the ASID value from the mm struct, interrupt occurs, changes
    > the ASID value, returns, we program the old ASID value.)

    Please note that we have this problem already, that's why Will posted
    the patch to disable the interrupts around cpu_switch_mm(). With this
    fix, even if cpu_switch_mm() happens in the post-switch hook, you
    don't really have any problem. In the worst case you set the same
    TTBR0 twice and maybe the first time with the old ASID followed
    immediately by the setting of the new ASID (with the corresponding TLB
    flushing). But that's all happening before getting to user space.

    To my original point of getting rid of current_mm - in the post-switch
    hook this would be equivalent to current->mm so no need for the
    per-cpu variable.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2011-05-29 23:23    [W:0.020 / U:9.568 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site