Thread (4 messages) 4 messages, 4 authors, 23h ago

Re: [PATCH v3] block: propagate in_flight to whole disk on partition I/O

From: Leon Hwang <hidden>
Date: 2026-05-22 13:53:48
Also in: lkml

On 2026/5/22 21:14, Tang Yizhou wrote:
From: Tang Yizhou <redacted>
[...]
quoted hunk ↗ jump to hunk
diff --git a/block/blk.h b/block/blk.h
index b998a7761faf..05099aab6863 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -4,6 +4,7 @@
 
 #include <linux/bio-integrity.h>
 #include <linux/blk-crypto.h>
+#include <linux/part_stat.h>
 #include <linux/lockdep.h>
 #include <linux/memblock.h>	/* for max_pfn/max_low_pfn */
 #include <linux/sched/sysctl.h>
@@ -11,6 +12,7 @@
 #include <xen/xen.h>
 #include "blk-crypto-internal.h"
 
+
NIT: I think this new line is added unintentionally. Should be dropped.

Thanks,
Leon

quoted hunk ↗ jump to hunk
 struct elv_change_ctx;
 
 /*
@@ -485,6 +487,26 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req)
 		q->last_merge = NULL;
 }
 
+static inline void bdev_inc_in_flight(struct block_device *bdev,
+				      enum req_op op)
+{
+	bool rw = op_is_write(op);
+
+	part_stat_local_inc(bdev, in_flight[rw]);
+	if (bdev_is_partition(bdev))
+		part_stat_local_inc(bdev_whole(bdev), in_flight[rw]);
+}
+
+static inline void bdev_dec_in_flight(struct block_device *bdev,
+				      enum req_op op)
+{
+	bool rw = op_is_write(op);
+
+	part_stat_local_dec(bdev, in_flight[rw]);
+	if (bdev_is_partition(bdev))
+		part_stat_local_dec(bdev_whole(bdev), in_flight[rw]);
+}
+
 /*
  * Internal io_context interface
  */
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help