[-next,6/8] md/md-multipath: enable io accounting

Message ID 20230619204826.755559-7-yukuai1@huaweicloud.com
State New
Headers
Series md: fix and refactor io accounting and 'active_io' |

Commit Message

Yu Kuai June 19, 2023, 8:48 p.m. UTC
  From: Yu Kuai <yukuai3@huawei.com>

use md_account_bio() to enable io accounting, also make sure
mddev_suspend() will wait for all io to be done.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/md/md-multipath.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Xiao Ni June 20, 2023, 9:11 a.m. UTC | #1
On Mon, Jun 19, 2023 at 8:50 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> From: Yu Kuai <yukuai3@huawei.com>
>
> use md_account_bio() to enable io accounting, also make sure
> mddev_suspend() will wait for all io to be done.
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/md/md-multipath.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/md/md-multipath.c b/drivers/md/md-multipath.c
> index 92c45be203d7..d22276870283 100644
> --- a/drivers/md/md-multipath.c
> +++ b/drivers/md/md-multipath.c
> @@ -107,6 +107,7 @@ static bool multipath_make_request(struct mddev *mddev, struct bio * bio)
>             && md_flush_request(mddev, bio))
>                 return true;
>
> +       md_account_bio(mddev, &bio);
>         mp_bh = mempool_alloc(&conf->pool, GFP_NOIO);
>
>         mp_bh->master_bio = bio;
> --
> 2.39.2
>

Reviewed-by: Xiao Ni <xni@redhat.com>
  

Patch

diff --git a/drivers/md/md-multipath.c b/drivers/md/md-multipath.c
index 92c45be203d7..d22276870283 100644
--- a/drivers/md/md-multipath.c
+++ b/drivers/md/md-multipath.c
@@ -107,6 +107,7 @@  static bool multipath_make_request(struct mddev *mddev, struct bio * bio)
 	    && md_flush_request(mddev, bio))
 		return true;
 
+	md_account_bio(mddev, &bio);
 	mp_bh = mempool_alloc(&conf->pool, GFP_NOIO);
 
 	mp_bh->master_bio = bio;