mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH for-6.12 2/2] blk-throttle: support prioritized processing of metadata
Date: Tue, 10 Sep 2024 11:19:18 -1000	[thread overview]
Message-ID: <ZuC31sqB6qUd_Gut@slm.duckdns.org> (raw)
In-Reply-To: <20240903135149.271857-3-yukuai1@huaweicloud.com>

On Tue, Sep 03, 2024 at 09:51:49PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> Currently, blk-throttle handle all IO fifo, hence if data IO is
> throttled and then meta IO is dispatched, the meta IO will have to wait
> for the data IO, causing priority inversion problems.
> 
> This patch support to handle metadata first and then pay debt while
> throttling data.
> 
> Test script: use cgroup v1 to throttle root cgroup, then create new
> dir and file while write back is throttled
> 
> test() {
>   mkdir /mnt/test/xxx
>   touch /mnt/test/xxx/1
>   sync /mnt/test/xxx
>   sync /mnt/test/xxx
> }
> 
> mkfs.ext4 -F /dev/nvme0n1 -E lazy_itable_init=0,lazy_journal_init=0
> mount /dev/nvme0n1 /mnt/test
> 
> echo "259:0 $((1024*1024))" > /sys/fs/cgroup/blkio/blkio.throttle.write_bps_device
> dd if=/dev/zero of=/mnt/test/foo1 bs=16M count=1 conv=fdatasync status=none &
> sleep 4
> 
> time test
> echo "259:0 0" > /sys/fs/cgroup/blkio/blkio.throttle.write_bps_device
> 
> sleep 1
> umount /dev/nvme0n1
> 
> Test result: time cost for creating new dir and file
> before this patch:  14s
> after this patch:   0.1s
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

This is a lot simpler than I expected. Great.

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2024-09-10 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 13:51 [PATCH for-6.12 0/2] " Yu Kuai
2024-09-03 13:51 ` [PATCH for-6.12 1/2] blk-throttle: remove last_low_overflow_time Yu Kuai
2024-09-10 21:02   ` Tejun Heo
2024-09-03 13:51 ` [PATCH for-6.12 2/2] blk-throttle: support prioritized processing of metadata Yu Kuai
2024-09-10 21:19   ` Tejun Heo [this message]
2024-09-10 22:39 ` [PATCH for-6.12 0/2] " Jens Axboe

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=ZuC31sqB6qUd_Gut@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.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®