lkml.org 
[lkml]   [2003]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Possible race condition in i386 global_irq_lock handling.
    thanks TeJun,

    just one comment

    On Fri, Aug 22, 2003 at 10:18:40AM +0900, TeJun Huh wrote:
    > 3. remove irqs_running() test from synchronize_irq()

    I'm not convinced this one is needed. An irq can still run on another
    cpu but the cli();sti() may execute while it's here:

    irq running synchronize_irq()
    -------------- -----------------
    do_IRQ
    handle_IRQ_event
    cli()
    sti()

    irq_enter -> way too late

    in short, doing irqs_running() doesn't seem to weaken the semantics of
    synchronize_irq() to me.

    I think it should be changed this way instead:

    void synchronize_irq(void)
    {
    smp_mb();
    if (irqs_running()) {
    /* Stupid approach */
    cli();
    sti();
    }
    }

    to be sure to read the local irq area after the previous code (the
    test_and_set_bit of the global_irq_lock of a cli() in your version would
    achieve the same implicit smp_mb too, so maybe your only point for doing
    cli()/sti() was to execute the smp_mb before the irqs_running?). the
    above version is more finegrined and it looks equivalent to yours.

    Andrea
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:48    [W:0.020 / U:2.540 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site