Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: axboe@kernel.dk, xni@redhat.com, agk@redhat.com,
	snitzer@kernel.org, mpatocka@redhat.com, song@kernel.org,
	yukuai3@huawei.com, viro@zeniv.linux.org.uk,
	akpm@linux-foundation.org, nadav.amit@gmail.com,
	ubizjak@gmail.com, cl@linux.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev,
	linux-raid@vger.kernel.org, yi.zhang@huawei.com,
	yangerkun@huawei.com, johnny.chenyi@huawei.com
Subject: Re: [PATCH v2 1/5] block: cleanup and export bdev IO inflight APIs
Date: Mon, 21 Apr 2025 04:59:57 -0700	[thread overview]
Message-ID: <aAYzPYGR_eF7qveO@infradead.org> (raw)
In-Reply-To: <20250418010941.667138-2-yukuai1@huaweicloud.com>

On Fri, Apr 18, 2025 at 09:09:37AM +0800, Yu Kuai wrote:
> - remove unused blk_mq_in_flight

That should probably be a separate patch.

> - rename blk_mq_in_flight_rw to blk_mq_count_in_driver_rw, to distinguish
>   from bdev_count_inflight_rw.

I'm not sure why this is needed or related, or even what additional
distinction is added here.

> -
> -void blk_mq_in_flight_rw(struct request_queue *q, struct block_device *part,
> -		unsigned int inflight[2])
> +void blk_mq_count_in_driver_rw(struct request_queue *q,
> +			       struct block_device *part,
> +			       unsigned int inflight[2])

Any reason to move away from two tab indents for the prototype
continuations in various places in this patch?

> + * Noted, for rq-based block device, use blk_mq_count_in_driver_rw() to get the
> + * number of requests issued to driver.

I'd just change this helper to call blk_mq_count_in_driver_rw for
blk-mq devices and remove the conditional from the sysfs code instead.
That gives us a much more robust and easier to understand API.

> +void bdev_count_inflight_rw(struct block_device *bdev, unsigned int inflight[2]);

Overly long line.

> +static inline unsigned int bdev_count_inflight(struct block_device *bdev)
> +{
> +	unsigned int inflight[2];
> +
> +	bdev_count_inflight_rw(bdev, inflight);
> +
> +	return inflight[0] + inflight[1];
> +}
>  #endif /* _LINUX_PART_STAT_H */

Maybe keep this inside of block as it should not not be used by
drivers?  Also the reimplementation should probably be a separate
patch from the public API change and exporting.


  reply	other threads:[~2025-04-21 12:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  1:09 [PATCH v2 0/5] md: fix is_mddev_idle() Yu Kuai
2025-04-18  1:09 ` [PATCH v2 1/5] block: cleanup and export bdev IO inflight APIs Yu Kuai
2025-04-21 11:59   ` Christoph Hellwig [this message]
2025-04-21 13:13     ` Yu Kuai
2025-04-22  6:11       ` Christoph Hellwig
2025-04-18  1:09 ` [PATCH v2 2/5] md: record dm-raid gendisk in mddev Yu Kuai
2025-04-22  6:00   ` Xiao Ni
2025-04-18  1:09 ` [PATCH v2 3/5] md: add a new api sync_io_depth Yu Kuai
2025-04-22  6:15   ` Xiao Ni
2025-04-18  1:09 ` [PATCH v2 4/5] md: fix is_mddev_idle() Yu Kuai
2025-04-19  1:42   ` Su Yue
2025-04-19  2:00     ` Yu Kuai
2025-04-19  5:03       ` Su Yue
2025-04-22  6:35   ` Xiao Ni
2025-04-27  1:37     ` Yu Kuai
2025-04-27  2:45       ` Xiao Ni
2025-04-18  1:09 ` [PATCH v2 5/5] md: cleanup accounting for issued sync IO Yu Kuai
2025-04-22  6:36   ` Xiao Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aAYzPYGR_eF7qveO@infradead.org \
    --to=hch@infradead.org \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=cl@linux.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=johnny.chenyi@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=nadav.amit@gmail.com \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=ubizjak@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox