On 8/12/19 7:55 AM, Bart Van Assche wrote: > On 8/12/19 5:39 AM, Julia Suvorova wrote: >> -#define mb() asm volatile("mfence" ::: "memory") >> -#define rmb() asm volatile("lfence" ::: "memory") >> -#define wmb() asm volatile("sfence" ::: "memory") >> -#define smp_rmb() barrier() >> -#define smp_wmb() barrier() >> +#define io_uring_mb() asm volatile("mfence" ::: "memory") >> +#define io_uring_rmb() asm volatile("lfence" ::: "memory") >> +#define io_uring_wmb() asm volatile("sfence" ::: "memory") >> +#define io_uring_smp_rmb() io_uring_barrier() >> +#define io_uring_smp_wmb() io_uring_barrier() > > Do users of liburing need these macros? If not, have you considered to > move these macros to a new header file that is only used inside liburing > and such that these macros are no longer visible to liburing users? The exposed API should not need any explicit barriers from the user, so this suggestion makes a lot of sense to me. -- Jens Axboe