public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] block: export dma_alignment attribute
@ 2022-05-13 16:13 Keith Busch
  2022-05-13 16:13 ` [PATCH 2/3] block: relax direct io memory alignment Keith Busch
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Keith Busch @ 2022-05-13 16:13 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, Kernel Team, Keith Busch

From: Keith Busch <kbusch@kernel.org>

User space may want to know how to align their buffers to avoid
bouncing. Export the queue attribute.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 block/blk-sysfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 88bd41d4cb59..14607565d781 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -274,6 +274,11 @@ static ssize_t queue_virt_boundary_mask_show(struct request_queue *q, char *page
 	return queue_var_show(q->limits.virt_boundary_mask, page);
 }
 
+static ssize_t queue_dma_alignment_show(struct request_queue *q, char *page)
+{
+	return queue_var_show(queue_dma_alignment(q), page);
+}
+
 #define QUEUE_SYSFS_BIT_FNS(name, flag, neg)				\
 static ssize_t								\
 queue_##name##_show(struct request_queue *q, char *page)		\
@@ -606,6 +611,7 @@ QUEUE_RO_ENTRY(queue_dax, "dax");
 QUEUE_RW_ENTRY(queue_io_timeout, "io_timeout");
 QUEUE_RW_ENTRY(queue_wb_lat, "wbt_lat_usec");
 QUEUE_RO_ENTRY(queue_virt_boundary_mask, "virt_boundary_mask");
+QUEUE_RO_ENTRY(queue_dma_alignment, "dma_alignment");
 
 #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
 QUEUE_RW_ENTRY(blk_throtl_sample_time, "throttle_sample_time");
@@ -667,6 +673,7 @@ static struct attribute *queue_attrs[] = {
 	&blk_throtl_sample_time_entry.attr,
 #endif
 	&queue_virt_boundary_mask_entry.attr,
+	&queue_dma_alignment_entry.attr,
 	NULL,
 };
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-18  7:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-13 16:13 [PATCH 1/3] block: export dma_alignment attribute Keith Busch
2022-05-13 16:13 ` [PATCH 2/3] block: relax direct io memory alignment Keith Busch
2022-05-13 16:13 ` [PATCH 3/3] block: ensure direct io is a block size Keith Busch
2022-05-14  2:26   ` Bart Van Assche
2022-05-16 10:13   ` Damien Le Moal
2022-05-16 14:01     ` Keith Busch
2022-05-16  6:52 ` [PATCH 1/3] block: export dma_alignment attribute Christoph Hellwig
2022-05-16 14:32   ` Keith Busch
2022-05-17 22:55     ` Keith Busch
2022-05-18  7:23       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox