On 8/31/20 8:12 AM, Christoph Hellwig wrote: > On Mon, Aug 31, 2020 at 08:02:43AM -0600, Jens Axboe wrote: >>>> The use case is async submissions, going through ->read_iter() again. >>>> Or ->write_iter(). >>> >>> But how does a bio flag help there? If we go through the file ops >>> again the next submission will be a new bio structure. >> >> Yeah the patch is garbage, can't work. The previous suggestion is here: >> >> https://lore.kernel.org/linux-block/395b4c19-cc80-eebb-f6ab-04687110c84a@xxxxxxxxx/T/ >> >> which isn't super pretty either, but at least it works. Not sure there's >> a better solution, outside of marking the iocb as retry and then >> carrying that flag forward for the bio as well. And that seems a bit >> much for this case. > > We'll still need a flag with the above to skip the submit_bio_noacct > bios. But I think it is the right way to go. Eventually we'll also > need to push the accounting down into the individual bio based drivers. For the iocb propagation, we'd really need the caller to mark the iocb as IOCB_ACCOUNTED (or whatever) if BIO_ACCOUNTED is set, since we can't do that further down the stack as we really don't know if we hit -EAGAIN before or after the bio was accounted... Which kind of sucks, as it'll be hard to contain in a generic fashion. -- Jens Axboe