diff mbox series

[RFC,v2,13/14] xfs: add an experimental CONFIG_XFS_LBS option

Message ID 20240213093713.1753368-14-kernel@pankajraghav.com (mailing list archive)
State New
Headers show
Series enable bs > ps in XFS | expand

Commit Message

Pankaj Raghav (Samsung) Feb. 13, 2024, 9:37 a.m. UTC
From: Pankaj Raghav <p.raghav@samsung.com>

Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS.
Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 fs/xfs/Kconfig     | 11 +++++++++++
 fs/xfs/xfs_mount.c |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Darrick J. Wong Feb. 13, 2024, 4:39 p.m. UTC | #1
On Tue, Feb 13, 2024 at 10:37:12AM +0100, Pankaj Raghav (Samsung) wrote:
> From: Pankaj Raghav <p.raghav@samsung.com>
> 
> Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS.
> Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>

With the changes I suggested in the next patch,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

(I think you ought to combine this patch and the next patch after
improving the EXPERIMENTAL log messaging.)

--D

> ---
>  fs/xfs/Kconfig     | 11 +++++++++++
>  fs/xfs/xfs_mount.c |  4 +++-
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig
> index 567fb37274d3..6b0db2f7dc13 100644
> --- a/fs/xfs/Kconfig
> +++ b/fs/xfs/Kconfig
> @@ -216,3 +216,14 @@ config XFS_ASSERT_FATAL
>  	  result in warnings.
>  
>  	  This behavior can be modified at runtime via sysfs.
> +
> +config XFS_LBS
> +	bool "XFS large block size support (EXPERIMENTAL)"
> +	depends on XFS_FS
> +	help
> +	  Set Y to enable support for filesystem block size > system's
> +	  base page size.
> +
> +	  This feature is considered EXPERIMENTAL.  Use with caution!
> +
> +	  If unsure, say N.
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index bfbaaecaf668..596aa2cdefbc 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -131,11 +131,13 @@ xfs_sb_validate_fsb_count(
>  	xfs_sb_t	*sbp,
>  	uint64_t	nblocks)
>  {
> -	ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
>  	ASSERT(sbp->sb_blocklog >= BBSHIFT);
>  	unsigned long mapping_count;
>  	uint64_t bytes = nblocks << sbp->sb_blocklog;
>  
> +	if (!IS_ENABLED(CONFIG_XFS_LBS))
> +		ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
> +
>  	mapping_count = bytes >> PAGE_SHIFT;
>  
>  	/* Limited by ULONG_MAX of page cache index */
> -- 
> 2.43.0
> 
>
Dave Chinner Feb. 13, 2024, 9:19 p.m. UTC | #2
On Tue, Feb 13, 2024 at 10:37:12AM +0100, Pankaj Raghav (Samsung) wrote:
> From: Pankaj Raghav <p.raghav@samsung.com>
> 
> Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS.
> Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>

NAK.

There it no reason for this existing - the same code is run
regardless of the state of this config variable just with a
difference in min folio order. All it does is increase the test
matrix arbitrarily - now we have two kernel configs we have to test
and there's no good reason for doing that.

-Dave.
Pankaj Raghav (Samsung) Feb. 13, 2024, 9:54 p.m. UTC | #3
On Wed, Feb 14, 2024 at 08:19:23AM +1100, Dave Chinner wrote:
> On Tue, Feb 13, 2024 at 10:37:12AM +0100, Pankaj Raghav (Samsung) wrote:
> > From: Pankaj Raghav <p.raghav@samsung.com>
> > 
> > Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS.
> > Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled.
> > 
> > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> 
> NAK.
> 
> There it no reason for this existing - the same code is run
> regardless of the state of this config variable just with a
> difference in min folio order. All it does is increase the test
> matrix arbitrarily - now we have two kernel configs we have to test
> and there's no good reason for doing that.

I did not have this CONFIG in the first round but I thought it might
help retain the existing behaviour until we deem the feature stable.

But I get your point. So we remove this CONFIG and just have an
experimental warning during mount when people are using the LBS support?

> 
> -Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
Dave Chinner Feb. 13, 2024, 10:45 p.m. UTC | #4
On Tue, Feb 13, 2024 at 10:54:07PM +0100, Pankaj Raghav (Samsung) wrote:
> On Wed, Feb 14, 2024 at 08:19:23AM +1100, Dave Chinner wrote:
> > On Tue, Feb 13, 2024 at 10:37:12AM +0100, Pankaj Raghav (Samsung) wrote:
> > > From: Pankaj Raghav <p.raghav@samsung.com>
> > > 
> > > Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS.
> > > Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled.
> > > 
> > > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> > 
> > NAK.
> > 
> > There it no reason for this existing - the same code is run
> > regardless of the state of this config variable just with a
> > difference in min folio order. All it does is increase the test
> > matrix arbitrarily - now we have two kernel configs we have to test
> > and there's no good reason for doing that.
> 
> I did not have this CONFIG in the first round but I thought it might
> help retain the existing behaviour until we deem the feature stable.
> 
> But I get your point. So we remove this CONFIG and just have an
> experimental warning during mount when people are using the LBS support?

Yes.

-Dave.
diff mbox series

Patch

diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig
index 567fb37274d3..6b0db2f7dc13 100644
--- a/fs/xfs/Kconfig
+++ b/fs/xfs/Kconfig
@@ -216,3 +216,14 @@  config XFS_ASSERT_FATAL
 	  result in warnings.
 
 	  This behavior can be modified at runtime via sysfs.
+
+config XFS_LBS
+	bool "XFS large block size support (EXPERIMENTAL)"
+	depends on XFS_FS
+	help
+	  Set Y to enable support for filesystem block size > system's
+	  base page size.
+
+	  This feature is considered EXPERIMENTAL.  Use with caution!
+
+	  If unsure, say N.
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index bfbaaecaf668..596aa2cdefbc 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -131,11 +131,13 @@  xfs_sb_validate_fsb_count(
 	xfs_sb_t	*sbp,
 	uint64_t	nblocks)
 {
-	ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
 	ASSERT(sbp->sb_blocklog >= BBSHIFT);
 	unsigned long mapping_count;
 	uint64_t bytes = nblocks << sbp->sb_blocklog;
 
+	if (!IS_ENABLED(CONFIG_XFS_LBS))
+		ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
+
 	mapping_count = bytes >> PAGE_SHIFT;
 
 	/* Limited by ULONG_MAX of page cache index */