public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, xni@redhat.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-raid@vger.kernel.org, yukuai1@huaweicloud.com,
	yi.zhang@huawei.com, yangerkun@huawei.com
Subject: [PATCH 1/4] block: export part_in_flight()
Date: Sat, 12 Apr 2025 15:31:59 +0800	[thread overview]
Message-ID: <20250412073202.3085138-2-yukuai1@huaweicloud.com> (raw)
In-Reply-To: <20250412073202.3085138-1-yukuai1@huaweicloud.com>

From: Yu Kuai <yukuai3@huawei.com>

This helper will be used in mdraid in later patches, check if there
are normal IO inflight while generating background sync IO, to fix a
problem in mdraid that foreground IO can be starved by background sync
IO.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/blk.h               | 1 -
 block/genhd.c             | 1 +
 include/linux/part_stat.h | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk.h b/block/blk.h
index 006e3be433d2..f476f233f195 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -418,7 +418,6 @@ void blk_apply_bdi_limits(struct backing_dev_info *bdi,
 int blk_dev_init(void);
 
 void update_io_ticks(struct block_device *part, unsigned long now, bool end);
-unsigned int part_in_flight(struct block_device *part);
 
 static inline void req_set_nomerge(struct request_queue *q, struct request *req)
 {
diff --git a/block/genhd.c b/block/genhd.c
index c2bd86cd09de..5b408d9b5a9d 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -139,6 +139,7 @@ unsigned int part_in_flight(struct block_device *part)
 
 	return inflight;
 }
+EXPORT_SYMBOL_GPL(part_in_flight);
 
 static void part_in_flight_rw(struct block_device *part,
 		unsigned int inflight[2])
diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h
index c5e9cac0575e..79ed730a8d50 100644
--- a/include/linux/part_stat.h
+++ b/include/linux/part_stat.h
@@ -79,4 +79,5 @@ static inline void part_stat_set_all(struct block_device *part, int value)
 #define part_stat_local_read_cpu(part, field, cpu)			\
 	local_read(&(part_stat_get_cpu(part, field, cpu)))
 
+unsigned int part_in_flight(struct block_device *part);
 #endif /* _LINUX_PART_STAT_H */
-- 
2.39.2


  reply	other threads:[~2025-04-12  7:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12  7:31 [PATCH 0/4] md: fix is_mddev_idle() Yu Kuai
2025-04-12  7:31 ` Yu Kuai [this message]
2025-04-14  6:32   ` [PATCH 1/4] block: export part_in_flight() Christoph Hellwig
2025-04-14  6:48     ` Yu Kuai
2025-04-14 11:39       ` Christoph Hellwig
2025-04-12  7:32 ` [PATCH 2/4] md: add a new api sync_io_depth Yu Kuai
2025-04-16  5:32   ` Xiao Ni
2025-04-16  8:19     ` Yu Kuai
2025-04-12  7:32 ` [PATCH 3/4] md: fix is_mddev_idle() Yu Kuai
2025-04-16  6:20   ` Xiao Ni
2025-04-16  7:42     ` Yu Kuai
2025-04-16  9:28       ` Yu Kuai
2025-04-16  9:44         ` Xiao Ni
2025-04-17  1:47           ` Yu Kuai
2025-04-12  7:32 ` [PATCH 4/4] md: cleanup accounting for issued sync IO Yu Kuai
2025-04-16  6:27   ` 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=20250412073202.3085138-2-yukuai1@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.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