Got a bug report on io_uring that submission time with O_DIRECT rose dramatically once the queue depth got higher. Turns out that __blkdev_direct_IO() does not honor IOCB_NOWAIT at all. blk-mq returns -EAGAIN errors through the bio end_io callback, which isn't super useful for cases where you want to pass this information back inline. Patch #1 adds a new flag for this, REQ_NOWAIT_INLINE, which makes submission return BLK_QC_T_EAGAIN if we would have blocked. Patch #2 then uses this in __blkdev_direct_IO() to return -EAGAIN, if we would have needed to block due to resource starvation. With this in place, submissions that would have blocked are correctly punted to async context by io_uring. Patches can also be found in my io_uring-test branch, which also include a test patch that adds a "io_uring submission blocked" debug patch for sched. -- Jens Axboe