[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240718070817.1031494-1-xue01.he@samsung.com>
Date: Thu, 18 Jul 2024 15:08:17 +0800
From: hexue <xue01.he@...sung.com>
To: axboe@...nel.dk
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, hexue
<xue01.he@...sung.com>
Subject: [PATCH v3] block: Avoid polling configuration errors
This patch add a poll queue check, aims to help users to use poll tolls
accurately.
If users do polled IO but device doesn't have poll queues, they will get
wrong perfromance data and waste CPU resources. So here adding a poll queue
check, if users do this misconfiguration, it will return users that device
does not support this operation, to help users adjust their configuration
promptly.
--
changes from v2:
- move check into block layer
- return -EOPNOTSUPP instead of print a warning in io_uring
v2: https://lore.kernel.org/io-uring/20240711082430.609597-1-xue01.he@samsung.com/T/#u
changes from v1:
- without disrupting the original I/O process.
- move judgement from block to io_uring.
v1: https://lore.kernel.org/linux-block/ZlrQCaR6xEaghWdQ@infradead.org/T/#t
Signed-off-by: hexue <xue01.he@...sung.com>
---
block/blk-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 82c3ae22d76d..9788808bd488 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -791,8 +791,11 @@ void submit_bio_noacct(struct bio *bio)
}
}
- if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+ if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags) &&
+ (bio->bi_opf & REQ_POLLED)) {
bio_clear_polled(bio);
+ goto not_supported;
+ }
switch (bio_op(bio)) {
case REQ_OP_READ:
--
2.40.1
Powered by blists - more mailing lists