mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: Tejun Heo <tj@kernel.org>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, yi.zhang@huawei.com,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH -next 4/5] blk-iocost: bypass if only one cgroup issues io
Date: Wed, 12 Oct 2022 09:33:46 +0800	[thread overview]
Message-ID: <c19008c3-512e-92cc-6be1-3ecc24e74341@huaweicloud.com> (raw)
In-Reply-To: <Y0WhpuqK/8CEZAGc@slm.duckdns.org>

Hi, Tejun!

在 2022/10/12 1:02, Tejun Heo 写道:
> On Tue, Oct 11, 2022 at 04:35:46PM +0800, Yu Kuai wrote:
>> From: Yu Kuai <yukuai3@huawei.com>
>>
>> In this special case, there is no need to throttle io.
>>
>> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
>> ---
>>   block/blk-iocost.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
>> index 5acc5f13bbd6..32e7e416d67c 100644
>> --- a/block/blk-iocost.c
>> +++ b/block/blk-iocost.c
>> @@ -2564,8 +2564,13 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio)
>>   	bool use_debt, ioc_locked;
>>   	unsigned long flags;
>>   
>> -	/* bypass IOs if disabled, still initializing, or for root cgroup */
>> -	if (!ioc->enabled || !iocg || !iocg->level)
>> +	/*
>> +	 * bypass IOs if disabled, still initializing, for root cgroup,
>> +	 * or the cgroup is the only cgroup with io.
>> +	 */
>> +	if (!ioc->enabled || !iocg || !iocg->level ||
>> +	    (iocg->hweight_inuse == WEIGHT_ONE &&
>> +	     atomic_read(&ioc->hweight_gen) == iocg->hweight_gen))
> 
> I'm not sure about this one. Bypassing here means that we lose track of how
> much IO it's issuing which can affect future throttling decisions, right?

Yes, you're right, this patch doesn't look good in this case.

The reason why I tried to do this is because during test, I found that
io performance is affected when I only issue io from one cgroup(only
happened in some environment with default configuration), and I found
out that each io is throttled for some time before dispatching.

Perhaps a suitable configuration can avoid this problem.

Thanks,
Kuai

> 
> Thanks.
> 


  reply	other threads:[~2022-10-12  1:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  8:35 [PATCH -next 0/5] blk-iocost: some random patches to improve iocost Yu Kuai
2022-10-11  8:35 ` [PATCH -next 1/5] blk-iocost: disable writeback throttling Yu Kuai
2022-10-11 16:54   ` Tejun Heo
2022-10-11  8:35 ` [PATCH -next 2/5] blk-iocost: don't release 'ioc->lock' while updating params Yu Kuai
2022-10-11 16:56   ` Tejun Heo
2022-10-11  8:35 ` [PATCH -next 3/5] blk-iocost: prevent configuration update concurrent with io throttling Yu Kuai
2022-10-11 17:03   ` Tejun Heo
2022-10-11  8:35 ` [PATCH -next 4/5] blk-iocost: bypass if only one cgroup issues io Yu Kuai
2022-10-11 17:02   ` Tejun Heo
2022-10-12  1:33     ` Yu Kuai [this message]
2022-10-12  8:04       ` Tejun Heo
2022-10-11  8:35 ` [PATCH -next 5/5] blk-iocost: read 'ioc->params' inside 'ioc->lock' in ioc_timer_fn() Yu Kuai
2022-10-11 17:01   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c19008c3-512e-92cc-6be1-3ecc24e74341@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®