From: Tejun Heo <tj@kernel.org> To: brookxu <brookxu.cn@gmail.com> Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v2] blk-throtl: optimize IOPS throttle for large IO scenarios Date: Thu, 29 Jul 2021 07:11:34 -1000 [thread overview] Message-ID: <YQLhRrkZrmKTzfbP@mtj.duckdns.org> (raw) In-Reply-To: <40915233274d31bb0659ff9f3be8900a5a0e81ba.1627462548.git.brookxu@tencent.com> Hello, On Wed, Jul 28, 2021 at 05:01:41PM +0800, brookxu wrote: > diff --git a/block/blk-merge.c b/block/blk-merge.c > index a11b3b5..86ff943 100644 > --- a/block/blk-merge.c > +++ b/block/blk-merge.c > @@ -348,6 +348,8 @@ void __blk_queue_split(struct bio **bio, unsigned int *nr_segs) > trace_block_split(split, (*bio)->bi_iter.bi_sector); > submit_bio_noacct(*bio); > *bio = split; > + > + blk_throtl_recharge_bio(*bio); Can you rename this blk_throtl_charge_bio_split()? > @@ -524,6 +537,11 @@ static struct blkg_policy_data *throtl_pd_alloc(gfp_t gfp, > tg->idletime_threshold = DFL_IDLE_THRESHOLD; > tg->idletime_threshold_conf = DFL_IDLE_THRESHOLD; > > + atomic_set(&tg->io_split_cnt[0], 0); > + atomic_set(&tg->io_split_cnt[1], 0); > + atomic_set(&tg->last_io_split_cnt[0], 0); > + atomic_set(&tg->last_io_split_cnt[1], 0); We likely don't need these. pd's zeroed on allocation. > @@ -877,10 +900,19 @@ static inline void throtl_trim_slice(struct throtl_grp *tg, bool rw) > else > tg->bytes_disp[rw] = 0; > > - if (tg->io_disp[rw] >= io_trim) > + if (tg_io_disp(tg, rw) >= io_trim) { Instead of checking this in multiple places, would it be simpler to transfer the atomic counters to the existing counters whenever we enter blk-throtl and leave the rest of the code as-is? Thanks. -- tejun
WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> To: brookxu <brookxu.cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH v2] blk-throtl: optimize IOPS throttle for large IO scenarios Date: Thu, 29 Jul 2021 07:11:34 -1000 [thread overview] Message-ID: <YQLhRrkZrmKTzfbP@mtj.duckdns.org> (raw) In-Reply-To: <40915233274d31bb0659ff9f3be8900a5a0e81ba.1627462548.git.brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org> Hello, On Wed, Jul 28, 2021 at 05:01:41PM +0800, brookxu wrote: > diff --git a/block/blk-merge.c b/block/blk-merge.c > index a11b3b5..86ff943 100644 > --- a/block/blk-merge.c > +++ b/block/blk-merge.c > @@ -348,6 +348,8 @@ void __blk_queue_split(struct bio **bio, unsigned int *nr_segs) > trace_block_split(split, (*bio)->bi_iter.bi_sector); > submit_bio_noacct(*bio); > *bio = split; > + > + blk_throtl_recharge_bio(*bio); Can you rename this blk_throtl_charge_bio_split()? > @@ -524,6 +537,11 @@ static struct blkg_policy_data *throtl_pd_alloc(gfp_t gfp, > tg->idletime_threshold = DFL_IDLE_THRESHOLD; > tg->idletime_threshold_conf = DFL_IDLE_THRESHOLD; > > + atomic_set(&tg->io_split_cnt[0], 0); > + atomic_set(&tg->io_split_cnt[1], 0); > + atomic_set(&tg->last_io_split_cnt[0], 0); > + atomic_set(&tg->last_io_split_cnt[1], 0); We likely don't need these. pd's zeroed on allocation. > @@ -877,10 +900,19 @@ static inline void throtl_trim_slice(struct throtl_grp *tg, bool rw) > else > tg->bytes_disp[rw] = 0; > > - if (tg->io_disp[rw] >= io_trim) > + if (tg_io_disp(tg, rw) >= io_trim) { Instead of checking this in multiple places, would it be simpler to transfer the atomic counters to the existing counters whenever we enter blk-throtl and leave the rest of the code as-is? Thanks. -- tejun
next prev parent reply other threads:[~2021-07-29 17:11 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-28 9:01 [PATCH v2] blk-throtl: optimize IOPS throttle for large IO scenarios brookxu 2021-07-29 17:11 ` Tejun Heo [this message] 2021-07-29 17:11 ` Tejun Heo 2021-07-30 2:09 ` brookxu 2021-07-30 16:07 ` Tejun Heo 2021-07-30 16:07 ` Tejun Heo 2021-08-02 1:30 ` brookxu 2021-08-02 1:30 ` brookxu
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=YQLhRrkZrmKTzfbP@mtj.duckdns.org \ --to=tj@kernel.org \ --cc=axboe@kernel.dk \ --cc=brookxu.cn@gmail.com \ --cc=cgroups@vger.kernel.org \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.