On Sat, Mar 23, 2019 at 5:30 AM Keith Busch <kbusch@xxxxxxxxxx> wrote: > > On Fri, Mar 22, 2019 at 03:05:46PM +0100, Hannes Reinecke wrote: > > On 3/22/19 3:02 PM, Christoph Hellwig wrote: > > > But how do you manage to get the tiny on-stack bios split? What kind > > > of setup is this? > > > > > It's not tiny if you send a 2M file via direct-io, _and_ have a non-zero > > MDTS setting... > > I see a larger request can create a bio chain (though I think 1M > is the max that goes through _simple), but how does the stack bio multi-page bvec is merged now, 1M isn't the max size any more. > get used in a bio_put()? The chained bios are allocated through a > bio_set, and their bio_end_io() calls bio_put() on themselves through > bio_chain_endio(), but that's it. The original's endio is never modified > from blkdev_bio_end_io_simple(), so who's calling bio_put() on the > on-stack bio? I have the same concern, blkdev_bio_end_io_simple() doesn't release the bio, and this bio shouldn't be released until __blkdev_direct_IO_simple() returns. How can any underlying driver or block layer free such bio coming from upper layer? thanks, Ming Lei