[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH][RFC] asm-generic:remove calling flush_write_buffers() in dma_sync_*_for_cpu
    On Monday 29 June 2009, Alan Cox wrote:
    > > Wouldn't it be better to put the flush_write_buffer in the specific
    > > operation (swiotlb_sync_*_for_*) rather than the multiplexer?
    > >
    > > Maybe in that case, smp_wmb() would be more appropriate because
    > > it is defined on all architectures.
    > smp_wmb() is stronger and it would slow down x86 if we did that (we'd go
    > from no-op on a coherent platform to using mfence/lfence etc)
    Really? In my copy of system.h, I read

    #ifdef CONFIG_SMP
    # ifdef CONFIG_X86_OOSTORE
    # define smp_wmb() wmb()
    # else
    # define smp_wmb() barrier()
    # endif
    # define smp_wmb() barrier()

    That actually looks weaker than flush_write_buffer, as it would turn into
    a barrier() in case of !SMP or !X86_OOSTORE, and into an sfence instead of
    lock addl on all modern CPUs in case of SMP && X86_OOSTORE.

    Of course that raises the question of whether smp_wmb() is too weak in case of
    !SMP or X86_PPRO_FENCE, but with the described scenario, I don't think
    it does.

    Arnd <><

     \ /
      Last update: 2009-06-29 18:49    [W:0.022 / U:21.976 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site