]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge tag 'realtime-groups-6.13_2024-11-05' of https://git.kernel.org/pub/scm/linux...
authorCarlos Maiolino <cem@kernel.org>
Tue, 12 Nov 2024 10:00:42 +0000 (11:00 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 12 Nov 2024 10:00:42 +0000 (11:00 +0100)
xfs: shard the realtime section [v5.5 06/10]

Right now, the realtime section uses a single pair of metadata inodes to
store the free space information.  This presents a scalability problem
since every thread trying to allocate or free rt extents have to lock
these files.  Solve this problem by sharding the realtime section into
separate realtime allocation groups.

While we're at it, define a superblock to be stamped into the start of
the rt section.  This enables utilities such as blkid to identify block
devices containing realtime sections, and avoids the situation where
anything written into block 0 of the realtime extent can be
misinterpreted as file data.

The best advantage for rtgroups will become evident later when we get to
adding rmap and reflink to the realtime volume, since the geometry
constraints are the same for rt groups and AGs.  Hence we can reuse all
that code directly.

This is a very large patchset, but it catches us up with 20 years of
technical debt that have accumulated.

With a bit of luck, this should all go splendidly.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
1  2 
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_sb.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_trace.h

Simple merge
index 5ca11c3c47116409e5e0e53b09978b105fcbc6eb,6a31f48a2c5424f109762f8fb33a4910f4dd1c36..c1254f019e53a538dc86471067a39cfa0c3c0f39
@@@ -400,21 -500,19 +500,33 @@@ xfs_validate_sb_common
                                         sbp->sb_inoalignmt, align);
                                return -EINVAL;
                        }
 +
 +                      if (!sbp->sb_spino_align ||
 +                          sbp->sb_spino_align > sbp->sb_inoalignmt ||
 +                          (sbp->sb_inoalignmt % sbp->sb_spino_align) != 0) {
 +                              xfs_warn(mp,
 +                              "Sparse inode alignment (%u) is invalid.",
 +                                      sbp->sb_spino_align);
 +                              return -EINVAL;
 +                      }
 +              } else if (sbp->sb_spino_align) {
 +                      xfs_warn(mp,
 +                              "Sparse inode alignment (%u) should be zero.",
 +                              sbp->sb_spino_align);
 +                      return -EINVAL;
                }
+               if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR) {
+                       if (memchr_inv(sbp->sb_pad, 0, sizeof(sbp->sb_pad))) {
+                               xfs_warn(mp,
+ "Metadir superblock padding fields must be zero.");
+                               return -EINVAL;
+                       }
+                       error = xfs_validate_sb_rtgroups(mp, sbp);
+                       if (error)
+                               return error;
+               }
        } else if (sbp->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD |
                                XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) {
                        xfs_notice(mp,
Simple merge
Simple merge
Simple merge