On Wed, May 13, 2020 at 01:59:32PM +0200, Christoph Hellwig wrote: > > + if (unlikely(direct_issue && rq->mq_ctx->cpu != raw_smp_processor_id())) > > + smp_mb(); > > + else > > + barrier(); > > Independ of the fact that I still think this is horrible and hacky, > I also still don't see what the barrier() is trying to help with. It is correct and clean to only add smp_mb() for ordering setting rq->tag/assigning req and checking INACTIVE, and just a normal usage of memory barrier. barrier() is used in most likely case because smp_mb() is only required when direct io issue process is migrated to other CPU, that seldom happens, so just an optimization. So I do not agree it is horrible and hacky. Thanks, Ming