Re: [PATCH -next] block: update io_ticks when io hang

From: Jens Axboe
Date: Wed Feb 16 2022 - 22:09:01 EST


On 2/16/22 8:07 PM, zhangwensheng (E) wrote:
> hi, Jens:
>
> I am sorry that there are some problems with the patch below:
>
>
> @@ -913,12 +913,14 @@ ssize_t part_stat_show(struct device *dev,
> struct disk_stats stat;
> unsigned int inflight;
> - part_stat_read_all(bdev, &stat);
> if (queue_is_mq(q))
> inflight = blk_mq_in_flight(q, bdev);
> else
> inflight = part_in_flight(bdev);
> + if (inflight)
> + update_io_ticks(bdev, jiffies, true);
> + part_stat_read_all(bdev, &stat);
> return sprintf(buf,
> "%8lu %8lu %8llu %8u "
> "%8lu %8lu %8llu %8u "
>
> It shoule use part_stat_lock() & part_stat_unlock() to protect update_io_ticks(),
>
> because it operates on per-cpu variables. And I will fix it in V2.

I'll drop it, please resend a fixed and tested one.

--
Jens Axboe