> /* Ensure that the device's view of memory matches the CPU's view of memory. > @@ -163,7 +78,25 @@ > memory types or non-temporal stores are required to use SFENCE in their own > code prior to calling verbs to start a DMA. > */ > -#define udma_to_device_barrier() wmb() > +#if defined(__i386__) > +#define udma_to_device_barrier() asm volatile("" ::: "memory") > +#elif defined(__x86_64__) > +#define udma_to_device_barrier() asm volatile("" ::: "memory") > +#elif defined(__PPC64__) > +#define udma_to_device_barrier() asm volatile("sync" ::: "memory") > +#elif defined(__PPC__) > +#define udma_to_device_barrier() asm volatile("sync" ::: "memory") > +#elif defined(__ia64__) > +#define udma_to_device_barrier() asm volatile("mf" ::: "memory") > +#elif defined(__sparc_v9__) > +#define udma_to_device_barrier() asm volatile("membar #StoreStore" ::: "memory") > +#elif defined(__aarch64__) > +#define wmb() asm volatile("dsb st" ::: "memory"); > +#elif defined(__sparc__) || defined(__s390x__) > +#define udma_to_device_barrier() asm volatile("" ::: "memory") > +#else > +#error No architecture specific memory barrier defines found! > +#endif In the kernel wmb() translates, for x86_64, into 'sfence'. In user-space, however wmb, and now its "successor", udma_to_device_barrier, translate to volatile("" ::: "memory") What is the reasoning behind this? Why aren't the kernel and user space implementations the same? Thanks, Ram -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html