lkml.org 
[lkml]   [2006]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: Synchronizing Bit operations V2
    Date
    Nick Piggin wrote on Thursday, March 30, 2006 11:35 PM
    > > >The memory ordering that above combination should produce is a
    > > >Linux style smp_mb before the clear_bit. Not a release.
    > >
    > > Whoever designed the smp_mb_before/after_* clearly understand the
    > > difference between a bidirectional smp_mb() and a one-way memory
    > > ordering. If smp_mb_before/after are equivalent to smp_mb, what's
    > > the point of introducing another interface?
    > >
    > They are not. They provide equivalent barrier when performed
    > before/after a clear_bit, there is a big difference.

    The usage so far that I can see for

    smp_mb__before_clear_bit()
    clear_bit

    is to close a critical section with clear_bit. I will be hard impressed
    to see a usage that allows stuff follows clear_bit to pass clear_bit, but
    not to pass the smp_mb_before_xxx.

    <end of critical section>
    smp_mb_before_clear_bit
    clear_bit
    <begin other code>

    But if you stand on the ground of smp_mb_before_xxx protects clear_bit
    from occurring before the "end of critical section", then smp_mb_before
    is such a brain dead interface and it is another good reason for having
    an explicit ordering mode built into the clear_bit.
    -
    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: 2006-03-31 20:58    [W:3.675 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site