Re: [PATCH] mkfs: use stx_blksize for dev block size by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 07, 2025 at 11:31:17AM -0800, Darrick J. Wong wrote:
> On Fri, Feb 07, 2025 at 11:26:20AM -0800, Luis Chamberlain wrote:
> > On Thu, Feb 06, 2025 at 02:27:16PM -0800, Darrick J. Wong wrote:
> > > NAME                     MIN-IO
> > > sda                         512
> > > ├─sda1                      512
> > > ├─sda2                      512
> > > │ └─node0.boot              512
> > > ├─sda3                      512
> > > │ └─node0.swap              512
> > > └─sda4                      512
> > >   └─node0.lvm               512
> > >     └─node0-root            512
> > > sdb                        4096
> > > └─sdb1                     4096
> > > nvme1n1                     512
> > > └─md0                    524288
> > >   └─node0.raid           524288
> > >     └─node0_raid-storage 524288
> > > nvme0n1                     512
> > > └─md0                    524288
> > >   └─node0.raid           524288
> > >     └─node0_raid-storage 524288
> > > nvme2n1                     512
> > > └─md0                    524288
> > >   └─node0.raid           524288
> > >     └─node0_raid-storage 524288
> > > nvme3n1                     512
> > > └─md0                    524288
> > >   └─node0.raid           524288
> > >     └─node0_raid-storage 524288
> > 
> > Can you try this for each of these:
> > 
> > stat --print=%o 
> > 
> > I believe that without that new patch I posted [0] you will get 4 KiB
> > here. Then the blocksize passed won't be the min-io until that patch
> > gets applied.
> 
> Yes, that returns 4K on 6.13.0 for every device in the list.  I think
> you're saying that stat will start returning 512K for the blocksize if
> your patch is merged?

Yes, as that *is* min-io for block devices.

> > The above is:
> > 
> > statx(AT_FDCWD, "/dev/nvme0n1", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, 0,
> > {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0,
> > stx_mode=S_IFBLK|0660, stx_size=0, ...}) = 0
> > 
> > So if we use this instead at mkfs, then even older kernels will get 4
> > KiB, and if distros want to automatically lift the value at mkfs, they
> > could cherry pick that simple patch.
> 
> How well does that work if the gold master image creator machine has a
> new kernel and a RAID setup, but the kernel written into the gold master
> image is something older than a 6.12 kernel?

I think you're asking about an image creator for an old release and that
old release uses an old kernel. Isn't that the same concern as what if
the same new kernel creates a filesystem on an image for an old release?
If so the risk is the new kernel defaults take precedence.

And the only thing I can think of for this case an option to ignore this
heuristic for blocksize, which could be used on configs to override
defaults for older target kernels.

  Luis




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux