On Mon, Jan 10, 2022 at 09:35:22AM -0800, Christoph Hellwig wrote: > On Mon, Jan 10, 2022 at 03:51:40PM +0800, Ming Lei wrote: > > Add block layer API of resubmit_bio_noacct() for handling blk-throttle > > iops limit correctly. Typical use case is that bio split, and it isn't > > good to export blk_throtl_charge_bio_split() for drivers, so add new API > > for serving such purpose. > > Umm, submit_bio_noacct is meant exactly for this case of resubmitting > a bio. We should not need another API for that. Follows the background of the issue first: 1) IOPS limit throttle needs to cover split bio since iostat accounts split bio actually, and user space setup iops limit throttle by the feedback from iostat/diskstat; 2) block throttle is block layer internal stuff, and we shouldn't expose blk_throtl_charge_bio_split() to driver. Maybe rename the new API as submit_split_bio_noacct(), but we can't reuse submit_bio_noacct() simply, otherwise blk_throtl_charge_bio_split() needs to be exported. Another ides is to clearing BIO_THROTTLED before calling submit_bio_noacct(), meantime blk-throttle code needs to change to avoid double accounting of bio bytes, so the caller of submit_bio_noacct() still needs some change. This way can get smooth IOPS throttle, but needs to call __blk_throtl_bio for split bio one more time. Or other idea for this bio split vs. iops limit issue? Thanks, Ming