Re: [PATCH v7 11/11] xfs: enable block size larger than page size support
From: Dave Chinner
Date: Sun Jun 16 2024 - 21:29:55 EST
On Thu, Jun 13, 2024 at 10:47:25AM +0200, Christoph Hellwig wrote:
> On Fri, Jun 07, 2024 at 02:59:02PM +0000, Pankaj Raghav (Samsung) wrote:
> > --- a/fs/xfs/libxfs/xfs_ialloc.c
> > +++ b/fs/xfs/libxfs/xfs_ialloc.c
> > @@ -3019,6 +3019,11 @@ xfs_ialloc_setup_geometry(
> > igeo->ialloc_align = mp->m_dalign;
> > else
> > igeo->ialloc_align = 0;
> > +
> > + if (mp->m_sb.sb_blocksize > PAGE_SIZE)
> > + igeo->min_folio_order = mp->m_sb.sb_blocklog - PAGE_SHIFT;
> > + else
> > + igeo->min_folio_order = 0;
> > }
>
> The minimum folio order isn't really part of the inode (allocation)
> geometry, is it?
I suggested it last time around instead of calculating the same
constant on every inode allocation. We're already storing in-memory
strunct xfs_inode allocation init values in this structure. e.g. in
xfs_inode_alloc() we see things like this:
ip->i_diflags2 = mp->m_ino_geo.new_diflags2;
So that we only calculate the default values for the filesystem once
instead of on every inode allocation. This isn't unreasonable
because xfs_inode_alloc() is a fairly hot path.
The only other place we might store it is the struct xfs_mount, but
given all the inode allocation constants are already in the embedded
mp->m_ino_geo structure, it just seems like a much better idea to
put it will all the other inode allocation constants than dump it
randomly into the struct xfs_mount....
-Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx