Re: [PATCH 4/4] block/part_stat: add helper blk_account_io_merge_bio()

From: Christoph Hellwig
Date: Mon May 04 2020 - 10:06:14 EST


On Mon, May 04, 2020 at 04:31:04PM +0300, Konstantin Khlebnikov wrote:
> Move non-"new_io" branch of blk_account_io_start() into separate function.
> Fix merge accounting for discards (they were counted as write merges).
>
> Also blk_account_io_merge_bio() doesn't call update_io_ticks() unlike to
> blk_account_io_start(), there is no reason for that.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Nitpick below:

> +void blk_account_io_start(struct request *rq)
> {
> struct hd_struct *part;
> int rw = rq_data_dir(rq);
>
> + if (blk_do_io_stat(rq)) {

part and rw probably should move inside this branch.