Re: [PATCH 7/7] blk-throtl: don't throttle the same IO multiple times
From: Tejun Heo
Date: Mon Nov 13 2017 - 06:13:57 EST
Hello, Shaohua.
On Sun, Nov 12, 2017 at 08:07:16PM -0800, Shaohua Li wrote:
> Thanks for looking into this while I was absence. I don't understand how this
> works. Assume a bio will be splitted into 2 small bios. In
> generic_make_request, we charge the whole bio. 'q->make_request_fn' will
> dispatch the first small bio, and call generic_make_request for the second
> small bio. Then generic_make_request charge the second small bio and we add the
> second small bio to current->bio_list[0] (please check the order). In above
You're right. If we wanna take this approach, we need to keep the
throttled flag while cloning. The clearing part is still correct tho.
Without that, I get 1/4 bw limit enforced. Hmm... I'm not quite sure
where that 1/4 is coming from tho. Will investigate more.
> code the patch changed, we pop the second small bio and set BIO_THROTTLED for
> it. But this is already too late, because generic_make_request already charged
> the second small bio.
>
> Did you look at my original patch
> (https://marc.info/?l=linux-block&m=150791825327628&w=2), anything wrong?
That should work too but if we have to modify clone path anyway and
clear the flag when the bio leaves the queue, we don't need to add a
dedicated field to bio, right?
Thanks.
--
tejun