linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] bdev: use bdev_io_min() for statx DIO min IO
@ 2024-06-28 21:23 Luis Chamberlain
  2024-06-29  6:25 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Chamberlain @ 2024-06-28 21:23 UTC (permalink / raw)
  To: p.raghav, hare, kbusch, david, neilb
  Cc: mcgrof, gost.dev, linux-block, linux-mm, patches

We currently rely on the block device logical block size for the
offset alignment. While this *works* it doesn't work with performance
in mind. That's exactly what the minimum_io_size attribute is for.

This would for example enhance performance for DIO on 4k IU drives which
have for example an LBA format of 512 bytes for both HDDs and NVMe.
Another use case is to ensure that DIO will be used with 16k IOs on
existing market 16k IU drives with an LBA format of 4k or 512 bytes.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 block/bdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/bdev.c b/block/bdev.c
index 1b4af2cc3b1e..5d0874aa8661 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1282,7 +1282,7 @@ void bdev_statx(struct inode *backing_inode, struct kstat *stat,
 
 	if (request_mask & STATX_DIOALIGN) {
 		stat->dio_mem_align = bdev_dma_alignment(bdev) + 1;
-		stat->dio_offset_align = bdev_logical_block_size(bdev);
+		stat->dio_offset_align = (unsigned int) bdev_io_min(bdev);
 		stat->result_mask |= STATX_DIOALIGN;
 	}
 
-- 
2.43.0


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

end of thread, other threads:[~2024-06-30 22:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28 21:23 [RFC] bdev: use bdev_io_min() for statx DIO min IO Luis Chamberlain
2024-06-29  6:25 ` Christoph Hellwig
2024-06-30  3:24   ` Luis Chamberlain
2024-06-30  5:54     ` Christoph Hellwig
2024-06-30 20:42       ` Luis Chamberlain
2024-06-30 22:35         ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).