On Wed, Aug 18, 2021 at 10:54:45AM -0600, Jens Axboe wrote: > We previously enabled this for O_DIRECT polled IO, however io_uring > completes all IO from task context these days, so it can be enabled for > that path too. This requires moving the bio_put() from IRQ context, and > this can be accomplished by passing the ownership back to the issuer. > > Use kiocb->private for that, which should be (as far as I can tell) free > once we get to the completion side of things. Add a IOCB_PUT_CACHE flag > to tell the issuer that we passed back the ownership, then the issuer > can put the bio from a safe context. > > Like the polled IO ditto, this is good for a 10% performance increase. > > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> > > --- > > Just hacked this up and tested it, Works For Me. Would welcome input on > alternative methods here, if anyone has good suggestions. 10% performance improvement looks really nice, but I don't think we can just hardcode assumptions about bios in iomap->private. The easiest would be to call back into the file systems for the freeing, but that would add an indirect call.