[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZZduPrwMrwOLQiU7@fedora>
Date: Fri, 5 Jan 2024 10:49:34 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: hch@....de, bvanassche@....org, axboe@...nel.dk,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
yukuai3@...wei.com, yi.zhang@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH for-6.8/block RFC v2] block: support to account io_ticks
precisely
On Wed, Jan 03, 2024 at 03:15:15PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@...wei.com>
>
> Currently, io_ticks is accounted based on sampling, specifically
> update_io_ticks() will always account io_ticks by 1 jiffies from
> bdev_start_io_acct()/blk_account_io_start(), and the result can be
> inaccurate, for example(HZ is 250):
>
> Test script:
> fio -filename=/dev/sda -bs=4k -rw=write -direct=1 -name=test -thinktime=4ms
>
> Test result: util is about 90%, while the disk is really idle.
>
> In order to account io_ticks precisely, update_io_ticks() must know if
> there are IO inflight already, and this requires overhead slightly,
> hence precise io accounting is disabled by default, and user can enable
> it through sysfs entry.
>
> Noted that for rq-based devcie, part_stat_local_inc/dec() and
> part_in_flight() is used to track inflight instead of iterating tags,
> which is not supposed to be used in fast path because 'tags->lock' is
> grabbed in blk_mq_find_and_get_req().
>
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ---
> Changes in v2:
> - remove the new parameter for update_io_ticks();
> - simplify update_io_ticks();
> - use swith in queue_iostats_store();
> - add missing part_stat_local_dec() in blk_account_io_merge_request()
Looks fine,
Reviewed-by: Ming Lei <ming.lei@...hat.com>
thanks,
Ming
Powered by blists - more mailing lists