[patch 1/3] generic-ipi: add smp_mb() before sending the IPI - Kernel

This is a discussion on [patch 1/3] generic-ipi: add smp_mb() before sending the IPI - Kernel ; smp_mb() (to make the memory operations visible globally) is needed before sending the ipi, if the receiver refers to the data(setup by the sender) in a lock-free fashion. On x86, x2apic mode accesses for sending IPI's don't have serializing semantics. ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [patch 1/3] generic-ipi: add smp_mb() before sending the IPI

  1. [patch 1/3] generic-ipi: add smp_mb() before sending the IPI

    smp_mb() (to make the memory operations visible globally) is needed before
    sending the ipi, if the receiver refers to the data(setup by the sender) in
    a lock-free fashion.

    On x86, x2apic mode accesses for sending IPI's don't have serializing
    semantics. So the need for smp_mb() before sending the IPI becomes more
    critical in x2apic mode.

    Signed-off-by: Suresh Siddha
    ---

    Index: linux-2.6.git/kernel/smp.c
    ================================================== =================
    --- linux-2.6.git.orig/kernel/smp.c 2008-10-31 11:15:11.000000000 -0700
    +++ linux-2.6.git/kernel/smp.c 2008-11-04 09:54:29.000000000 -0800
    @@ -76,6 +76,11 @@
    list_add_tail(&data->list, &dst->list);
    spin_unlock_irqrestore(&dst->lock, flags);

    + /*
    + * Make the list addition visible before sending the ipi.
    + */
    + smp_mb();
    +
    if (ipi)
    arch_send_call_function_single_ipi(cpu);

    @@ -370,6 +375,11 @@
    list_add_tail_rcu(&data->csd.list, &call_function_queue);
    spin_unlock_irqrestore(&call_function_lock, flags);

    + /*
    + * Make the list addition visible before sending the ipi.
    + */
    + smp_mb();
    +
    /* Send a message to all CPUs in the map */
    arch_send_call_function_ipi(mask);


    --

    --
    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/

  2. Re: [patch 2/3] x86: Add smp_mb() before sending INVALIDATE_TLB_VECTOR


    * Suresh Siddha wrote:

    > On x86, x2apic mode accesses for sending IPI's don't have
    > serializing semantics. If the IPI receiver refers(in lock-free
    > fashion) to some memory setup by the sender, the need for smp_mb()
    > before sending the IPI becomes critical in x2apic mode.
    >
    > Add the smp_mb() in native_flush_tlb_others() before sending the
    > IPI.
    >
    > Signed-off-by: Suresh Siddha


    applied to tip/x86/urgent, thanks Suresh!

    Jens, you'll send 1/3 and 3/3 to Linus, right?

    Ingo
    --
    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/

  3. Re: [patch 2/3] x86: Add smp_mb() before sending INVALIDATE_TLB_VECTOR

    On Thu, Nov 06 2008, Ingo Molnar wrote:
    >
    > * Suresh Siddha wrote:
    >
    > > On x86, x2apic mode accesses for sending IPI's don't have
    > > serializing semantics. If the IPI receiver refers(in lock-free
    > > fashion) to some memory setup by the sender, the need for smp_mb()
    > > before sending the IPI becomes critical in x2apic mode.
    > >
    > > Add the smp_mb() in native_flush_tlb_others() before sending the
    > > IPI.
    > >
    > > Signed-off-by: Suresh Siddha

    >
    > applied to tip/x86/urgent, thanks Suresh!
    >
    > Jens, you'll send 1/3 and 3/3 to Linus, right?


    Yes, it's in for-linus and I'll send the pull request today.

    --
    Jens Axboe

    --
    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/

+ Reply to Thread