Thread (7 messages) 7 messages, 3 authors, 2020-07-17

Re: [PATCH v4] md: improve io stats accounting

From: Song Liu <song@kernel.org>
Date: 2020-07-04 00:32:40

On Fri, Jul 3, 2020 at 2:27 AM Guoqing Jiang
[off-list ref] wrote:
Looks good, Acked-by: Guoqing Jiang [off-list ref]

Thanks,
Guoqing

On 7/3/20 11:13 AM, Artur Paszkiewicz wrote:
quoted
Use generic io accounting functions to manage io stats. There was an
attempt to do this earlier in commit 18c0b223cf99 ("md: use generic io
stats accounting functions to simplify io stat accounting"), but it did
not include a call to generic_end_io_acct() and caused issues with
tracking in-flight IOs, so it was later removed in commit 74672d069b29
("md: fix md io stats accounting broken").

This patch attempts to fix this by using both disk_start_io_acct() and
disk_end_io_acct(). To make it possible, a struct md_io is allocated for
every new md bio, which includes the io start_time. A new mempool is
introduced for this purpose. We override bio->bi_end_io with our own
callback and call disk_start_io_acct() before passing the bio to
md_handle_request(). When it completes, we call disk_end_io_acct() and
the original bi_end_io callback.

This adds correct statistics about in-flight IOs and IO processing time,
interpreted e.g. in iostat as await, svctm, aqu-sz and %util.

It also fixes a situation where too many IOs where reported if a bio was
re-submitted to the mddev, because io accounting is now performed only
on newly arriving bios.

Signed-off-by: Artur Paszkiewicz <redacted>
Applied to md-next. Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help