* actually exercise sub-block direct I/O reads
@ 2026-08-31 6:51 Christoph Hellwig
2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig
` (4 more replies)
0 siblings, 5 replies; 22+ messages in thread
From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests
Hi all,
when looking into testing changes that might require a minimum read size
larger than a page size, I realized that various tests hard code
PAGE_SIZE as a direct I/O read size despite claiming that they exercise
sub-block direct I/O.
This series adds support to query the minimum read size and actually uses
that for testing.
^ permalink raw reply [flat|nested] 22+ messages in thread* [PATCH 1/5] statx.h: update to latest kernel UAPI 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig @ 2026-08-31 6:51 ` Christoph Hellwig 2026-08-31 17:12 ` Darrick J. Wong 2026-09-02 15:31 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig ` (3 subsequent siblings) 4 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw) To: Zorro Lang; +Cc: fstests Update the localy provided statx definition to the kernel UAPI as of 7.3-rc1. Signed-off-by: Christoph Hellwig <hch@lst.de> --- src/statx.h | 126 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 96 insertions(+), 30 deletions(-) diff --git a/src/statx.h b/src/statx.h index bae1c86f6201..0a27bf030b1d 100644 --- a/src/statx.h +++ b/src/statx.h @@ -95,44 +95,97 @@ struct statx_timestamp { */ struct statx { /* 0x00 */ - __u32 stx_mask; /* What results were written [uncond] */ - __u32 stx_blksize; /* Preferred general I/O size [uncond] */ - __u64 stx_attributes; /* Flags conveying information about the file [uncond] */ + /* What results were written [uncond] */ + __u32 stx_mask; + + /* Preferred general I/O size [uncond] */ + __u32 stx_blksize; + + /* Flags conveying information about the file [uncond] */ + __u64 stx_attributes; + /* 0x10 */ - __u32 stx_nlink; /* Number of hard links */ - __u32 stx_uid; /* User ID of owner */ - __u32 stx_gid; /* Group ID of owner */ - __u16 stx_mode; /* File mode */ + /* Number of hard links */ + __u32 stx_nlink; + + /* User ID of owner */ + __u32 stx_uid; + + /* Group ID of owner */ + __u32 stx_gid; + + /* File mode */ + __u16 stx_mode; __u16 __spare0[1]; + /* 0x20 */ - __u64 stx_ino; /* Inode number */ - __u64 stx_size; /* File size */ - __u64 stx_blocks; /* Number of 512-byte blocks allocated */ - __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */ + /* Inode number */ + __u64 stx_ino; + + /* File size */ + __u64 stx_size; + + /* Number of 512-byte blocks allocated */ + __u64 stx_blocks; + + /* Mask to show what's supported in stx_attributes */ + __u64 stx_attributes_mask; /* 0x40 */ - struct statx_timestamp stx_atime; /* Last access time */ - struct statx_timestamp stx_btime; /* File creation time */ - struct statx_timestamp stx_ctime; /* Last attribute change time */ - struct statx_timestamp stx_mtime; /* Last data modification time */ + /* Last access time */ + struct statx_timestamp stx_atime; + + /* File creation time */ + struct statx_timestamp stx_btime; + + /* Last attribute change time */ + struct statx_timestamp stx_ctime; + + /* Last data modification time */ + struct statx_timestamp stx_mtime; + /* 0x80 */ - __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */ + /* Device ID of special file [if bdev/cdev] */ + __u32 stx_rdev_major; __u32 stx_rdev_minor; - __u32 stx_dev_major; /* ID of device containing file [uncond] */ + + /* ID of device containing file [uncond] */ + __u32 stx_dev_major; __u32 stx_dev_minor; + /* 0x90 */ __u64 stx_mnt_id; - __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */ - __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */ + + /* Memory buffer alignment for direct I/O */ + __u32 stx_dio_mem_align; + + /* File offset alignment for direct I/O */ + __u32 stx_dio_offset_align; + /* 0xa0 */ - __u64 stx_subvol; /* Subvolume identifier */ - __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */ - __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */ + /* Subvolume identifier */ + __u64 stx_subvol; + + /* Min atomic write unit in bytes */ + __u32 stx_atomic_write_unit_min; + + /* Max atomic write unit in bytes */ + __u32 stx_atomic_write_unit_max; + /* 0xb0 */ - __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */ - __u32 __spare1[1]; - /* 0xb8 */ - __u64 __spare3[9]; /* Spare space for future expansion */ + /* Max atomic write segment count */ + __u32 stx_atomic_write_segments_max; + + /* File offset alignment for direct I/O reads */ + __u32 stx_dio_read_offset_align; + + /* Optimised max atomic write unit in bytes */ + __u32 stx_atomic_write_unit_max_opt; + __u32 __spare2[1]; + + /* 0xc0 */ + __u64 __spare3[8]; /* Spare space for future expansion */ + /* 0x100 */ }; @@ -162,19 +215,32 @@ struct statx { #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */ #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */ +#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */ -#define STATX_ALL 0x00000fffU /* All currently supported flags */ +#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ +#ifndef __KERNEL__ /* - * Attributes to be found in stx_attributes + * This is deprecated, and shall remain the same value in the future. To avoid + * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME) + * instead. + */ +#define STATX_ALL 0x00000fffU +#endif + +/* + * Attributes to be found in stx_attributes and masked in stx_attributes_mask. * * These give information about the features or the state of a file that might * be of use to ordinary userspace programs such as GUIs or ls rather than * specialised tools. * - * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS + * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags * semantically. Where possible, the numerical value is picked to correspond - * also. + * also. Note that the DAX attribute indicates that the file is in the CPU + * direct access state. It does not correspond to the per-inode flag that + * some filesystems support. + * */ #define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */ #define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */ -- 2.53.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] statx.h: update to latest kernel UAPI 2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig @ 2026-08-31 17:12 ` Darrick J. Wong 2026-09-02 15:31 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Darrick J. Wong @ 2026-08-31 17:12 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Zorro Lang, fstests On Mon, Aug 31, 2026 at 09:51:04AM +0300, Christoph Hellwig wrote: > Update the localy provided statx definition to the kernel UAPI as of > 7.3-rc1. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Seems fine to me; Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > src/statx.h | 126 +++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 96 insertions(+), 30 deletions(-) > > diff --git a/src/statx.h b/src/statx.h > index bae1c86f6201..0a27bf030b1d 100644 > --- a/src/statx.h > +++ b/src/statx.h > @@ -95,44 +95,97 @@ struct statx_timestamp { > */ > struct statx { > /* 0x00 */ > - __u32 stx_mask; /* What results were written [uncond] */ > - __u32 stx_blksize; /* Preferred general I/O size [uncond] */ > - __u64 stx_attributes; /* Flags conveying information about the file [uncond] */ > + /* What results were written [uncond] */ > + __u32 stx_mask; > + > + /* Preferred general I/O size [uncond] */ > + __u32 stx_blksize; > + > + /* Flags conveying information about the file [uncond] */ > + __u64 stx_attributes; > + > /* 0x10 */ > - __u32 stx_nlink; /* Number of hard links */ > - __u32 stx_uid; /* User ID of owner */ > - __u32 stx_gid; /* Group ID of owner */ > - __u16 stx_mode; /* File mode */ > + /* Number of hard links */ > + __u32 stx_nlink; > + > + /* User ID of owner */ > + __u32 stx_uid; > + > + /* Group ID of owner */ > + __u32 stx_gid; > + > + /* File mode */ > + __u16 stx_mode; > __u16 __spare0[1]; > + > /* 0x20 */ > - __u64 stx_ino; /* Inode number */ > - __u64 stx_size; /* File size */ > - __u64 stx_blocks; /* Number of 512-byte blocks allocated */ > - __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */ > + /* Inode number */ > + __u64 stx_ino; > + > + /* File size */ > + __u64 stx_size; > + > + /* Number of 512-byte blocks allocated */ > + __u64 stx_blocks; > + > + /* Mask to show what's supported in stx_attributes */ > + __u64 stx_attributes_mask; > > /* 0x40 */ > - struct statx_timestamp stx_atime; /* Last access time */ > - struct statx_timestamp stx_btime; /* File creation time */ > - struct statx_timestamp stx_ctime; /* Last attribute change time */ > - struct statx_timestamp stx_mtime; /* Last data modification time */ > + /* Last access time */ > + struct statx_timestamp stx_atime; > + > + /* File creation time */ > + struct statx_timestamp stx_btime; > + > + /* Last attribute change time */ > + struct statx_timestamp stx_ctime; > + > + /* Last data modification time */ > + struct statx_timestamp stx_mtime; > + > /* 0x80 */ > - __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */ > + /* Device ID of special file [if bdev/cdev] */ > + __u32 stx_rdev_major; > __u32 stx_rdev_minor; > - __u32 stx_dev_major; /* ID of device containing file [uncond] */ > + > + /* ID of device containing file [uncond] */ > + __u32 stx_dev_major; > __u32 stx_dev_minor; > + > /* 0x90 */ > __u64 stx_mnt_id; > - __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */ > - __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */ > + > + /* Memory buffer alignment for direct I/O */ > + __u32 stx_dio_mem_align; > + > + /* File offset alignment for direct I/O */ > + __u32 stx_dio_offset_align; > + > /* 0xa0 */ > - __u64 stx_subvol; /* Subvolume identifier */ > - __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */ > - __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */ > + /* Subvolume identifier */ > + __u64 stx_subvol; > + > + /* Min atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_min; > + > + /* Max atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_max; > + > /* 0xb0 */ > - __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */ > - __u32 __spare1[1]; > - /* 0xb8 */ > - __u64 __spare3[9]; /* Spare space for future expansion */ > + /* Max atomic write segment count */ > + __u32 stx_atomic_write_segments_max; > + > + /* File offset alignment for direct I/O reads */ > + __u32 stx_dio_read_offset_align; > + > + /* Optimised max atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_max_opt; > + __u32 __spare2[1]; > + > + /* 0xc0 */ > + __u64 __spare3[8]; /* Spare space for future expansion */ > + > /* 0x100 */ > }; > > @@ -162,19 +215,32 @@ struct statx { > #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ > #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */ > #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */ > +#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */ > > -#define STATX_ALL 0x00000fffU /* All currently supported flags */ > +#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ > > +#ifndef __KERNEL__ > /* > - * Attributes to be found in stx_attributes > + * This is deprecated, and shall remain the same value in the future. To avoid > + * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME) > + * instead. > + */ > +#define STATX_ALL 0x00000fffU > +#endif > + > +/* > + * Attributes to be found in stx_attributes and masked in stx_attributes_mask. > * > * These give information about the features or the state of a file that might > * be of use to ordinary userspace programs such as GUIs or ls rather than > * specialised tools. > * > - * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS > + * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags > * semantically. Where possible, the numerical value is picked to correspond > - * also. > + * also. Note that the DAX attribute indicates that the file is in the CPU > + * direct access state. It does not correspond to the per-inode flag that > + * some filesystems support. > + * > */ > #define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */ > #define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */ > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 1/5] statx.h: update to latest kernel UAPI 2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig 2026-08-31 17:12 ` Darrick J. Wong @ 2026-09-02 15:31 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-02 15:31 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:04AM +0300, Christoph Hellwig wrote: > Update the localy provided statx definition to the kernel UAPI as of This patch looks good to me, I'll change "localy" to "locally" when I merge it. Thanks! Reviewed-by: Zorro Lang <zlang@kernel.org> > 7.3-rc1. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > src/statx.h | 126 +++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 96 insertions(+), 30 deletions(-) > > diff --git a/src/statx.h b/src/statx.h > index bae1c86f6201..0a27bf030b1d 100644 > --- a/src/statx.h > +++ b/src/statx.h > @@ -95,44 +95,97 @@ struct statx_timestamp { > */ > struct statx { > /* 0x00 */ > - __u32 stx_mask; /* What results were written [uncond] */ > - __u32 stx_blksize; /* Preferred general I/O size [uncond] */ > - __u64 stx_attributes; /* Flags conveying information about the file [uncond] */ > + /* What results were written [uncond] */ > + __u32 stx_mask; > + > + /* Preferred general I/O size [uncond] */ > + __u32 stx_blksize; > + > + /* Flags conveying information about the file [uncond] */ > + __u64 stx_attributes; > + > /* 0x10 */ > - __u32 stx_nlink; /* Number of hard links */ > - __u32 stx_uid; /* User ID of owner */ > - __u32 stx_gid; /* Group ID of owner */ > - __u16 stx_mode; /* File mode */ > + /* Number of hard links */ > + __u32 stx_nlink; > + > + /* User ID of owner */ > + __u32 stx_uid; > + > + /* Group ID of owner */ > + __u32 stx_gid; > + > + /* File mode */ > + __u16 stx_mode; > __u16 __spare0[1]; > + > /* 0x20 */ > - __u64 stx_ino; /* Inode number */ > - __u64 stx_size; /* File size */ > - __u64 stx_blocks; /* Number of 512-byte blocks allocated */ > - __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */ > + /* Inode number */ > + __u64 stx_ino; > + > + /* File size */ > + __u64 stx_size; > + > + /* Number of 512-byte blocks allocated */ > + __u64 stx_blocks; > + > + /* Mask to show what's supported in stx_attributes */ > + __u64 stx_attributes_mask; > > /* 0x40 */ > - struct statx_timestamp stx_atime; /* Last access time */ > - struct statx_timestamp stx_btime; /* File creation time */ > - struct statx_timestamp stx_ctime; /* Last attribute change time */ > - struct statx_timestamp stx_mtime; /* Last data modification time */ > + /* Last access time */ > + struct statx_timestamp stx_atime; > + > + /* File creation time */ > + struct statx_timestamp stx_btime; > + > + /* Last attribute change time */ > + struct statx_timestamp stx_ctime; > + > + /* Last data modification time */ > + struct statx_timestamp stx_mtime; > + > /* 0x80 */ > - __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */ > + /* Device ID of special file [if bdev/cdev] */ > + __u32 stx_rdev_major; > __u32 stx_rdev_minor; > - __u32 stx_dev_major; /* ID of device containing file [uncond] */ > + > + /* ID of device containing file [uncond] */ > + __u32 stx_dev_major; > __u32 stx_dev_minor; > + > /* 0x90 */ > __u64 stx_mnt_id; > - __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */ > - __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */ > + > + /* Memory buffer alignment for direct I/O */ > + __u32 stx_dio_mem_align; > + > + /* File offset alignment for direct I/O */ > + __u32 stx_dio_offset_align; > + > /* 0xa0 */ > - __u64 stx_subvol; /* Subvolume identifier */ > - __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */ > - __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */ > + /* Subvolume identifier */ > + __u64 stx_subvol; > + > + /* Min atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_min; > + > + /* Max atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_max; > + > /* 0xb0 */ > - __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */ > - __u32 __spare1[1]; > - /* 0xb8 */ > - __u64 __spare3[9]; /* Spare space for future expansion */ > + /* Max atomic write segment count */ > + __u32 stx_atomic_write_segments_max; > + > + /* File offset alignment for direct I/O reads */ > + __u32 stx_dio_read_offset_align; > + > + /* Optimised max atomic write unit in bytes */ > + __u32 stx_atomic_write_unit_max_opt; > + __u32 __spare2[1]; > + > + /* 0xc0 */ > + __u64 __spare3[8]; /* Spare space for future expansion */ > + > /* 0x100 */ > }; > > @@ -162,19 +215,32 @@ struct statx { > #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ > #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */ > #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */ > +#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */ > > -#define STATX_ALL 0x00000fffU /* All currently supported flags */ > +#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ > > +#ifndef __KERNEL__ > /* > - * Attributes to be found in stx_attributes > + * This is deprecated, and shall remain the same value in the future. To avoid > + * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME) > + * instead. > + */ > +#define STATX_ALL 0x00000fffU > +#endif > + > +/* > + * Attributes to be found in stx_attributes and masked in stx_attributes_mask. > * > * These give information about the features or the state of a file that might > * be of use to ordinary userspace programs such as GUIs or ls rather than > * specialised tools. > * > - * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS > + * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags > * semantically. Where possible, the numerical value is picked to correspond > - * also. > + * also. Note that the DAX attribute indicates that the file is in the CPU > + * direct access state. It does not correspond to the per-inode flag that > + * some filesystems support. > + * > */ > #define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */ > #define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */ > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig 2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig @ 2026-08-31 6:51 ` Christoph Hellwig 2026-08-31 17:16 ` Darrick J. Wong ` (2 more replies) 2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig ` (2 subsequent siblings) 4 siblings, 3 replies; 22+ messages in thread From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw) To: Zorro Lang; +Cc: fstests Add an option to query the STATX_DIO_READ_ALIGN if provided. Signed-off-by: Christoph Hellwig <hch@lst.de> --- src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c index 866fba1546c4..143cee684ab4 100644 --- a/src/min_dio_alignment.c +++ b/src/min_dio_alignment.c @@ -1,17 +1,19 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2024 Christoph Hellwig + * Copyright (c) 2024,2026 Christoph Hellwig */ #include <fcntl.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <getopt.h> #include <sys/mount.h> #include <sys/ioctl.h> #include <sys/stat.h> #include "statx.h" -static int min_dio_alignment(const char *mntpnt, const char *devname) +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) { struct statx stx = { }; struct stat st; @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) */ fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); if (fd >= 0 && - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) - return stx.stx_dio_offset_align; + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { + if (read && + (stx.stx_mask & STATX_DIO_READ_ALIGN) && + stx.stx_dio_read_offset_align != 0) + return stx.stx_dio_read_offset_align; + + if ((stx.stx_mask & STATX_DIOALIGN) && + stx.stx_dio_offset_align != 0) + return stx.stx_dio_offset_align; + } /* * If we are on a block device and no explicit aligned is reported, use @@ -42,9 +51,8 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) if (dev_fd > 0 && fstat(dev_fd, &st) == 0 && S_ISBLK(st.st_mode) && - ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) { + ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) return logical_block_size; - } } /* @@ -56,11 +64,25 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) int main(int argc, char **argv) { - if (argc != 3) { - fprintf(stderr, "usage: %s mountpoint devicename\n", argv[0]); - exit(1); + bool read = false; + int c; + + while ((c = getopt(argc, argv, "r")) != -1) { + switch(c) { + case 'r': + read = 1; + break; + default: + goto usage; + } } - printf("%d\n", min_dio_alignment(argv[1], argv[2])); + if (argc - optind != 2) + goto usage; + + printf("%d\n", min_dio_alignment(argv[optind], argv[optind + 1], read)); exit(0); +usage: + fprintf(stderr, "usage: %s [-r] mountpoint devicename\n", argv[0]); + exit(1); } -- 2.53.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig @ 2026-08-31 17:16 ` Darrick J. Wong 2026-09-02 16:26 ` Zorro Lang 2026-09-02 16:31 ` Zorro Lang 2 siblings, 0 replies; 22+ messages in thread From: Darrick J. Wong @ 2026-08-31 17:16 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Zorro Lang, fstests On Mon, Aug 31, 2026 at 09:51:05AM +0300, Christoph Hellwig wrote: > Add an option to query the STATX_DIO_READ_ALIGN if provided. > > Signed-off-by: Christoph Hellwig <hch@lst.de> This makes sense to me. It's sorta nice to have a canonical example of how you're supposed to access the directio geometry fields :) Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- > 1 file changed, 33 insertions(+), 11 deletions(-) > > diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c > index 866fba1546c4..143cee684ab4 100644 > --- a/src/min_dio_alignment.c > +++ b/src/min_dio_alignment.c > @@ -1,17 +1,19 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (c) 2024 Christoph Hellwig > + * Copyright (c) 2024,2026 Christoph Hellwig > */ > #include <fcntl.h> > +#include <stdbool.h> > #include <stdio.h> > #include <stdlib.h> > #include <unistd.h> > +#include <getopt.h> > #include <sys/mount.h> > #include <sys/ioctl.h> > #include <sys/stat.h> > #include "statx.h" > > -static int min_dio_alignment(const char *mntpnt, const char *devname) > +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) > { > struct statx stx = { }; > struct stat st; > @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > */ > fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); > if (fd >= 0 && > - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) > - return stx.stx_dio_offset_align; > + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { > + if (read && > + (stx.stx_mask & STATX_DIO_READ_ALIGN) && > + stx.stx_dio_read_offset_align != 0) > + return stx.stx_dio_read_offset_align; > + > + if ((stx.stx_mask & STATX_DIOALIGN) && > + stx.stx_dio_offset_align != 0) > + return stx.stx_dio_offset_align; > + } > > /* > * If we are on a block device and no explicit aligned is reported, use > @@ -42,9 +51,8 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > if (dev_fd > 0 && > fstat(dev_fd, &st) == 0 && > S_ISBLK(st.st_mode) && > - ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) { > + ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) > return logical_block_size; > - } > } > > /* > @@ -56,11 +64,25 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > > int main(int argc, char **argv) > { > - if (argc != 3) { > - fprintf(stderr, "usage: %s mountpoint devicename\n", argv[0]); > - exit(1); > + bool read = false; > + int c; > + > + while ((c = getopt(argc, argv, "r")) != -1) { > + switch(c) { > + case 'r': > + read = 1; > + break; > + default: > + goto usage; > + } > } > > - printf("%d\n", min_dio_alignment(argv[1], argv[2])); > + if (argc - optind != 2) > + goto usage; > + > + printf("%d\n", min_dio_alignment(argv[optind], argv[optind + 1], read)); > exit(0); > +usage: > + fprintf(stderr, "usage: %s [-r] mountpoint devicename\n", argv[0]); > + exit(1); > } > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig 2026-08-31 17:16 ` Darrick J. Wong @ 2026-09-02 16:26 ` Zorro Lang 2026-09-03 5:34 ` Christoph Hellwig 2026-09-02 16:31 ` Zorro Lang 2 siblings, 1 reply; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:26 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:05AM +0300, Christoph Hellwig wrote: > Add an option to query the STATX_DIO_READ_ALIGN if provided. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- > 1 file changed, 33 insertions(+), 11 deletions(-) > > diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c > index 866fba1546c4..143cee684ab4 100644 > --- a/src/min_dio_alignment.c > +++ b/src/min_dio_alignment.c > @@ -1,17 +1,19 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (c) 2024 Christoph Hellwig > + * Copyright (c) 2024,2026 Christoph Hellwig > */ > #include <fcntl.h> > +#include <stdbool.h> > #include <stdio.h> > #include <stdlib.h> > #include <unistd.h> > +#include <getopt.h> > #include <sys/mount.h> > #include <sys/ioctl.h> > #include <sys/stat.h> > #include "statx.h" > > -static int min_dio_alignment(const char *mntpnt, const char *devname) > +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) > { > struct statx stx = { }; > struct stat st; > @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > */ > fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); > if (fd >= 0 && > - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) > - return stx.stx_dio_offset_align; > + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { Hmm... shouldn't STATX_DIO_READ_ALIGN be passed in the request mask as well? xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN|STATX_DIO_READ_ALIGN, &stx) > + if (read && > + (stx.stx_mask & STATX_DIO_READ_ALIGN) && > + stx.stx_dio_read_offset_align != 0) > + return stx.stx_dio_read_offset_align; > + > + if ((stx.stx_mask & STATX_DIOALIGN) && > + stx.stx_dio_offset_align != 0) > + return stx.stx_dio_offset_align; > + } > > /* > * If we are on a block device and no explicit aligned is reported, use > @@ -42,9 +51,8 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > if (dev_fd > 0 && > fstat(dev_fd, &st) == 0 && > S_ISBLK(st.st_mode) && > - ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) { > + ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) > return logical_block_size; > - } > } > > /* > @@ -56,11 +64,25 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > > int main(int argc, char **argv) > { > - if (argc != 3) { > - fprintf(stderr, "usage: %s mountpoint devicename\n", argv[0]); > - exit(1); > + bool read = false; > + int c; > + > + while ((c = getopt(argc, argv, "r")) != -1) { > + switch(c) { > + case 'r': > + read = 1; > + break; > + default: > + goto usage; > + } > } > > - printf("%d\n", min_dio_alignment(argv[1], argv[2])); > + if (argc - optind != 2) > + goto usage; > + > + printf("%d\n", min_dio_alignment(argv[optind], argv[optind + 1], read)); > exit(0); > +usage: > + fprintf(stderr, "usage: %s [-r] mountpoint devicename\n", argv[0]); > + exit(1); > } > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-09-02 16:26 ` Zorro Lang @ 2026-09-03 5:34 ` Christoph Hellwig 2026-09-03 13:39 ` Zorro Lang 0 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2026-09-03 5:34 UTC (permalink / raw) To: Christoph Hellwig, fstests On Thu, Sep 03, 2026 at 12:26:26AM +0800, Zorro Lang wrote: > On Mon, Aug 31, 2026 at 09:51:05AM +0300, Christoph Hellwig wrote: > > Add an option to query the STATX_DIO_READ_ALIGN if provided. > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > --- > > src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- > > 1 file changed, 33 insertions(+), 11 deletions(-) > > > > diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c > > index 866fba1546c4..143cee684ab4 100644 > > --- a/src/min_dio_alignment.c > > +++ b/src/min_dio_alignment.c > > @@ -1,17 +1,19 @@ > > // SPDX-License-Identifier: GPL-2.0 > > /* > > - * Copyright (c) 2024 Christoph Hellwig > > + * Copyright (c) 2024,2026 Christoph Hellwig > > */ > > #include <fcntl.h> > > +#include <stdbool.h> > > #include <stdio.h> > > #include <stdlib.h> > > #include <unistd.h> > > +#include <getopt.h> > > #include <sys/mount.h> > > #include <sys/ioctl.h> > > #include <sys/stat.h> > > #include "statx.h" > > > > -static int min_dio_alignment(const char *mntpnt, const char *devname) > > +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) > > { > > struct statx stx = { }; > > struct stat st; > > @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > > */ > > fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); > > if (fd >= 0 && > > - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > > - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) > > - return stx.stx_dio_offset_align; > > + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { > > > Hmm... shouldn't STATX_DIO_READ_ALIGN be passed in the request mask as well? > > xfstests_statx(fd, "", AT_EMPTY_PATH, > STATX_DIOALIGN|STATX_DIO_READ_ALIGN, &stx) Yeah, strictly speaking we should. Currently this is only supported for XFS, and XFS automatically adds STATX_DIO_READ_ALIGN when STATX_DIOALIGN is requested, so it works. But more by chance than design. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-09-03 5:34 ` Christoph Hellwig @ 2026-09-03 13:39 ` Zorro Lang 0 siblings, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-03 13:39 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Thu, Sep 03, 2026 at 07:34:09AM +0200, Christoph Hellwig wrote: > On Thu, Sep 03, 2026 at 12:26:26AM +0800, Zorro Lang wrote: > > On Mon, Aug 31, 2026 at 09:51:05AM +0300, Christoph Hellwig wrote: > > > Add an option to query the STATX_DIO_READ_ALIGN if provided. > > > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > > --- > > > src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- > > > 1 file changed, 33 insertions(+), 11 deletions(-) > > > > > > diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c > > > index 866fba1546c4..143cee684ab4 100644 > > > --- a/src/min_dio_alignment.c > > > +++ b/src/min_dio_alignment.c > > > @@ -1,17 +1,19 @@ > > > // SPDX-License-Identifier: GPL-2.0 > > > /* > > > - * Copyright (c) 2024 Christoph Hellwig > > > + * Copyright (c) 2024,2026 Christoph Hellwig > > > */ > > > #include <fcntl.h> > > > +#include <stdbool.h> > > > #include <stdio.h> > > > #include <stdlib.h> > > > #include <unistd.h> > > > +#include <getopt.h> > > > #include <sys/mount.h> > > > #include <sys/ioctl.h> > > > #include <sys/stat.h> > > > #include "statx.h" > > > > > > -static int min_dio_alignment(const char *mntpnt, const char *devname) > > > +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) > > > { > > > struct statx stx = { }; > > > struct stat st; > > > @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > > > */ > > > fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); > > > if (fd >= 0 && > > > - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > > > - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) > > > - return stx.stx_dio_offset_align; > > > + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { > > > > > > Hmm... shouldn't STATX_DIO_READ_ALIGN be passed in the request mask as well? > > > > xfstests_statx(fd, "", AT_EMPTY_PATH, > > STATX_DIOALIGN|STATX_DIO_READ_ALIGN, &stx) > > Yeah, strictly speaking we should. Currently this is only supported > for XFS, and XFS automatically adds STATX_DIO_READ_ALIGN when > STATX_DIOALIGN is requested, so it works. But more by chance than > design. I couldn't find any mention in the statx doc that STATX_DIO_READ_ALIGN is added by default, explicitly specifying it seems more aligned with how the mask parameter is intended to work. Would you like me to fold this in when merging? or did you omit it due to other concerns? This is the only open point left for the patchset, once we reach consensus, I'm good to merge it :) Thanks, Zorro > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig 2026-08-31 17:16 ` Darrick J. Wong 2026-09-02 16:26 ` Zorro Lang @ 2026-09-02 16:31 ` Zorro Lang 2 siblings, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:31 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:05AM +0300, Christoph Hellwig wrote: > Add an option to query the STATX_DIO_READ_ALIGN if provided. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > src/min_dio_alignment.c | 44 ++++++++++++++++++++++++++++++----------- > 1 file changed, 33 insertions(+), 11 deletions(-) > > diff --git a/src/min_dio_alignment.c b/src/min_dio_alignment.c > index 866fba1546c4..143cee684ab4 100644 > --- a/src/min_dio_alignment.c > +++ b/src/min_dio_alignment.c > @@ -1,17 +1,19 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (c) 2024 Christoph Hellwig > + * Copyright (c) 2024,2026 Christoph Hellwig > */ > #include <fcntl.h> > +#include <stdbool.h> > #include <stdio.h> > #include <stdlib.h> > #include <unistd.h> > +#include <getopt.h> > #include <sys/mount.h> > #include <sys/ioctl.h> > #include <sys/stat.h> > #include "statx.h" > > -static int min_dio_alignment(const char *mntpnt, const char *devname) > +static int min_dio_alignment(const char *mntpnt, const char *devname, bool read) > { > struct statx stx = { }; > struct stat st; > @@ -27,9 +29,16 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > */ > fd = open(mntpnt, O_TMPFILE | O_RDWR | O_EXCL, 0600); > if (fd >= 0 && > - xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > - (stx.stx_mask & STATX_DIOALIGN) && stx.stx_dio_offset_align != 0) > - return stx.stx_dio_offset_align; > + xfstests_statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0) { > + if (read && > + (stx.stx_mask & STATX_DIO_READ_ALIGN) && > + stx.stx_dio_read_offset_align != 0) > + return stx.stx_dio_read_offset_align; > + > + if ((stx.stx_mask & STATX_DIOALIGN) && > + stx.stx_dio_offset_align != 0) > + return stx.stx_dio_offset_align; > + } > > /* > * If we are on a block device and no explicit aligned is reported, use > @@ -42,9 +51,8 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > if (dev_fd > 0 && > fstat(dev_fd, &st) == 0 && > S_ISBLK(st.st_mode) && > - ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) { > + ioctl(dev_fd, BLKSSZGET, &logical_block_size) == 0) > return logical_block_size; > - } > } > > /* > @@ -56,11 +64,25 @@ static int min_dio_alignment(const char *mntpnt, const char *devname) > > int main(int argc, char **argv) > { > - if (argc != 3) { > - fprintf(stderr, "usage: %s mountpoint devicename\n", argv[0]); > - exit(1); > + bool read = false; > + int c; > + > + while ((c = getopt(argc, argv, "r")) != -1) { > + switch(c) { > + case 'r': > + read = 1; read = true; > + break; > + default: > + goto usage; > + } > } > > - printf("%d\n", min_dio_alignment(argv[1], argv[2])); > + if (argc - optind != 2) > + goto usage; > + > + printf("%d\n", min_dio_alignment(argv[optind], argv[optind + 1], read)); > exit(0); > +usage: > + fprintf(stderr, "usage: %s [-r] mountpoint devicename\n", argv[0]); > + exit(1); > } > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 3/5] generic/091: enable sub-block reads 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig 2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig @ 2026-08-31 6:51 ` Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:39 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig 2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig 4 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw) To: Zorro Lang; +Cc: fstests The description of generic/091 claims that it tries to exercise sub-block direct I/O, but the test currently limits reads to PAGE_SIZE alignment. Use the new min_dio_alignment -r option to query the minimal read alignment and only limit the read alignment to that. Signed-off-by: Christoph Hellwig <hch@lst.de> --- tests/generic/091 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/091 b/tests/generic/091 index 5cdf04890c0e..b2fba09d39ef 100755 --- a/tests/generic/091 +++ b/tests/generic/091 @@ -15,8 +15,8 @@ _begin_fstest rw auto quick _require_test _require_odirect -psize=`$here/src/feature -s` bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` # fsx usage: # -- 2.53.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] generic/091: enable sub-block reads 2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig @ 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:46 ` Zorro Lang 2026-09-02 16:39 ` Zorro Lang 1 sibling, 1 reply; 22+ messages in thread From: Darrick J. Wong @ 2026-08-31 17:19 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Zorro Lang, fstests On Mon, Aug 31, 2026 at 09:51:06AM +0300, Christoph Hellwig wrote: > The description of generic/091 claims that it tries to exercise sub-block > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > Use the new min_dio_alignment -r option to query the minimal read > alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> I've long wondered about why reads are the page size when xfs could easily do smaller... Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > tests/generic/091 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/091 b/tests/generic/091 > index 5cdf04890c0e..b2fba09d39ef 100755 > --- a/tests/generic/091 > +++ b/tests/generic/091 > @@ -15,8 +15,8 @@ _begin_fstest rw auto quick > _require_test > _require_odirect > > -psize=`$here/src/feature -s` > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` > > # fsx usage: > # > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] generic/091: enable sub-block reads 2026-08-31 17:19 ` Darrick J. Wong @ 2026-09-02 16:46 ` Zorro Lang 2026-09-03 5:34 ` Christoph Hellwig 0 siblings, 1 reply; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:46 UTC (permalink / raw) To: Darrick J. Wong; +Cc: Christoph Hellwig, fstests On Mon, Aug 31, 2026 at 10:19:31AM -0700, Darrick J. Wong wrote: > On Mon, Aug 31, 2026 at 09:51:06AM +0300, Christoph Hellwig wrote: > > The description of generic/091 claims that it tries to exercise sub-block > > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > > > Use the new min_dio_alignment -r option to query the minimal read > > alignment and only limit the read alignment to that. > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > I've long wondered about why reads are the page size when xfs could > easily do smaller... Maybe we should rename psize/PSIZE in _run_fsx_on_file helper (and cases call *run_fsx* function) as well? Keeping that name for DIO read alignment doesn't quite match the new semantics introduced by this series. Thanks, Zorro > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> > > --D > > > --- > > tests/generic/091 | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tests/generic/091 b/tests/generic/091 > > index 5cdf04890c0e..b2fba09d39ef 100755 > > --- a/tests/generic/091 > > +++ b/tests/generic/091 > > @@ -15,8 +15,8 @@ _begin_fstest rw auto quick > > _require_test > > _require_odirect > > > > -psize=`$here/src/feature -s` > > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` > > > > # fsx usage: > > # > > -- > > 2.53.0 > > > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] generic/091: enable sub-block reads 2026-09-02 16:46 ` Zorro Lang @ 2026-09-03 5:34 ` Christoph Hellwig 2026-09-03 13:33 ` Zorro Lang 0 siblings, 1 reply; 22+ messages in thread From: Christoph Hellwig @ 2026-09-03 5:34 UTC (permalink / raw) To: Darrick J. Wong, Christoph Hellwig, fstests On Thu, Sep 03, 2026 at 12:46:54AM +0800, Zorro Lang wrote: > On Mon, Aug 31, 2026 at 10:19:31AM -0700, Darrick J. Wong wrote: > > On Mon, Aug 31, 2026 at 09:51:06AM +0300, Christoph Hellwig wrote: > > > The description of generic/091 claims that it tries to exercise sub-block > > > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > > > > > Use the new min_dio_alignment -r option to query the minimal read > > > alignment and only limit the read alignment to that. > > > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > > > I've long wondered about why reads are the page size when xfs could > > easily do smaller... > > Maybe we should rename psize/PSIZE in _run_fsx_on_file helper (and cases > call *run_fsx* function) as well? Keeping that name for DIO read alignment > doesn't quite match the new semantics introduced by this series. Heh. I found these substituations weird, but also don't really undestand the purpose. Why don't we just pass these as explicit arguments anyway? ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] generic/091: enable sub-block reads 2026-09-03 5:34 ` Christoph Hellwig @ 2026-09-03 13:33 ` Zorro Lang 0 siblings, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-03 13:33 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Darrick J. Wong, fstests On Thu, Sep 03, 2026 at 07:34:51AM +0200, Christoph Hellwig wrote: > On Thu, Sep 03, 2026 at 12:46:54AM +0800, Zorro Lang wrote: > > On Mon, Aug 31, 2026 at 10:19:31AM -0700, Darrick J. Wong wrote: > > > On Mon, Aug 31, 2026 at 09:51:06AM +0300, Christoph Hellwig wrote: > > > > The description of generic/091 claims that it tries to exercise sub-block > > > > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > > > > > > > Use the new min_dio_alignment -r option to query the minimal read > > > > alignment and only limit the read alignment to that. > > > > > > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > > > > > I've long wondered about why reads are the page size when xfs could > > > easily do smaller... > > > > Maybe we should rename psize/PSIZE in _run_fsx_on_file helper (and cases > > call *run_fsx* function) as well? Keeping that name for DIO read alignment > > doesn't quite match the new semantics introduced by this series. > > Heh. I found these substituations weird, but also don't really undestand > the purpose. Why don't we just pass these as explicit arguments anyway? This change traces back to commit 3597757462a7 ("fsx: Small improvements and fixes") from a decade ago. It moved run_fsx directly from a local test-case function into a common helper without any modifications. This issue doesn't block your patch series. I'll send a follow-up series to clean up run_fsx once this is merged, so let's keep the focus on your changes for now :) > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 3/5] generic/091: enable sub-block reads 2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong @ 2026-09-02 16:39 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:39 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:06AM +0300, Christoph Hellwig wrote: > The description of generic/091 claims that it tries to exercise sub-block > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > Use the new min_dio_alignment -r option to query the minimal read > alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > tests/generic/091 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/091 b/tests/generic/091 > index 5cdf04890c0e..b2fba09d39ef 100755 > --- a/tests/generic/091 > +++ b/tests/generic/091 > @@ -15,8 +15,8 @@ _begin_fstest rw auto quick > _require_test > _require_odirect > > -psize=`$here/src/feature -s` > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` Good to me, Reviewed-by: Zorro Lang <zlang@kernel.org> > > # fsx usage: > # > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 4/5] generic/263: enable sub-block reads 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig ` (2 preceding siblings ...) 2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig @ 2026-08-31 6:51 ` Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:48 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig 4 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw) To: Zorro Lang; +Cc: fstests The description of generic/263 claims that it tries to exercise sub-block direct I/O, but the test currently limits reads to PAGE_SIZE alignment. Use the new min_dio_alignment -r option to query the minimal read alignment and only limit the read alignment to that. Signed-off-by: Christoph Hellwig <hch@lst.de> --- tests/generic/263 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/263 b/tests/generic/263 index 91cfbe5253bd..c456d62ebd43 100755 --- a/tests/generic/263 +++ b/tests/generic/263 @@ -15,7 +15,7 @@ _begin_fstest rw auto quick _require_test _require_odirect -psize=`$here/src/feature -s` +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` run_fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -- 2.53.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 4/5] generic/263: enable sub-block reads 2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig @ 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:48 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Darrick J. Wong @ 2026-08-31 17:19 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Zorro Lang, fstests On Mon, Aug 31, 2026 at 09:51:07AM +0300, Christoph Hellwig wrote: > The description of generic/263 claims that it tries to exercise sub-block > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > Use the new min_dio_alignment -r option to query the minimal read > alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks ok, Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > tests/generic/263 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/263 b/tests/generic/263 > index 91cfbe5253bd..c456d62ebd43 100755 > --- a/tests/generic/263 > +++ b/tests/generic/263 > @@ -15,7 +15,7 @@ _begin_fstest rw auto quick > _require_test > _require_odirect > > -psize=`$here/src/feature -s` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > > run_fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 4/5] generic/263: enable sub-block reads 2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong @ 2026-09-02 16:48 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:48 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:07AM +0300, Christoph Hellwig wrote: > The description of generic/263 claims that it tries to exercise sub-block > direct I/O, but the test currently limits reads to PAGE_SIZE alignment. > > Use the new min_dio_alignment -r option to query the minimal read > alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > tests/generic/263 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/263 b/tests/generic/263 > index 91cfbe5253bd..c456d62ebd43 100755 > --- a/tests/generic/263 > +++ b/tests/generic/263 > @@ -15,7 +15,7 @@ _begin_fstest rw auto quick > _require_test > _require_odirect > > -psize=`$here/src/feature -s` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` Makes sense to me (except the "psize" name, I think we should update that later). Reviewed-by: Zorro Lang <zlang@kernel.org> > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > > run_fsx -N 10000 -o 8192 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/5] generic/760: enable sub-block reads 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig ` (3 preceding siblings ...) 2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig @ 2026-08-31 6:51 ` Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:49 ` Zorro Lang 4 siblings, 2 replies; 22+ messages in thread From: Christoph Hellwig @ 2026-08-31 6:51 UTC (permalink / raw) To: Zorro Lang; +Cc: fstests generic/760 currently limits reads to PAGE_SIZE alignments while allowing smaller writes. Use the new min_dio_alignment -r option to query the minimal read alignment and only limit the read alignment to that. Signed-off-by: Christoph Hellwig <hch@lst.de> --- tests/generic/760 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/760 b/tests/generic/760 index f270636e56a3..facd83e4af0c 100755 --- a/tests/generic/760 +++ b/tests/generic/760 @@ -16,7 +16,7 @@ _require_odirect _require_thp _require_hugepage_fsx -psize=`$here/src/feature -s` +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` _run_hugepage_fsx -N 10000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W -- 2.53.0 ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] generic/760: enable sub-block reads 2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig @ 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:49 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Darrick J. Wong @ 2026-08-31 17:19 UTC (permalink / raw) To: Christoph Hellwig; +Cc: Zorro Lang, fstests On Mon, Aug 31, 2026 at 09:51:08AM +0300, Christoph Hellwig wrote: > generic/760 currently limits reads to PAGE_SIZE alignments while allowing > smaller writes. Use the new min_dio_alignment -r option to query the minimal > read alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Looks ok, Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > tests/generic/760 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/760 b/tests/generic/760 > index f270636e56a3..facd83e4af0c 100755 > --- a/tests/generic/760 > +++ b/tests/generic/760 > @@ -16,7 +16,7 @@ _require_odirect > _require_thp > _require_hugepage_fsx > > -psize=`$here/src/feature -s` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > > _run_hugepage_fsx -N 10000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W > -- > 2.53.0 > > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 5/5] generic/760: enable sub-block reads 2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong @ 2026-09-02 16:49 ` Zorro Lang 1 sibling, 0 replies; 22+ messages in thread From: Zorro Lang @ 2026-09-02 16:49 UTC (permalink / raw) To: Christoph Hellwig; +Cc: fstests On Mon, Aug 31, 2026 at 09:51:08AM +0300, Christoph Hellwig wrote: > generic/760 currently limits reads to PAGE_SIZE alignments while allowing > smaller writes. Use the new min_dio_alignment -r option to query the minimal > read alignment and only limit the read alignment to that. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > tests/generic/760 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/generic/760 b/tests/generic/760 > index f270636e56a3..facd83e4af0c 100755 > --- a/tests/generic/760 > +++ b/tests/generic/760 > @@ -16,7 +16,7 @@ _require_odirect > _require_thp > _require_hugepage_fsx > > -psize=`$here/src/feature -s` > +psize=`$here/src/min_dio_alignment -r $TEST_DIR $TEST_DEV` Reviewed-by: Zorro Lang <zlang@kernel.org> > bsize=`$here/src/min_dio_alignment $TEST_DIR $TEST_DEV` > > _run_hugepage_fsx -N 10000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z -R -W > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2026-09-03 13:39 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig 2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig 2026-08-31 17:12 ` Darrick J. Wong 2026-09-02 15:31 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig 2026-08-31 17:16 ` Darrick J. Wong 2026-09-02 16:26 ` Zorro Lang 2026-09-03 5:34 ` Christoph Hellwig 2026-09-03 13:39 ` Zorro Lang 2026-09-02 16:31 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:46 ` Zorro Lang 2026-09-03 5:34 ` Christoph Hellwig 2026-09-03 13:33 ` Zorro Lang 2026-09-02 16:39 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:48 ` Zorro Lang 2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig 2026-08-31 17:19 ` Darrick J. Wong 2026-09-02 16:49 ` Zorro Lang
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.