btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG
authorQu Wenruo <wqu@suse.com>
Mon, 16 Sep 2024 08:48:25 +0000 (18:18 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:12 +0000 (14:34 +0100)
Currently CONFIG_BTRFS_EXPERIMENTAL is not only for the extra debugging
output, but also for experimental features.

This is not ideal to distinguish planned but not yet stable features
from those purely designed for debugging.

This patch splits the following features into CONFIG_BTRFS_EXPERIMENTAL:

- Extent map shrinker
  This seems to be the first one to exit experimental.

- Extent tree v2
  This seems to be the last one to graduate from experimental.

- Raid stripe tree
- Csum offload mode
- Send protocol v3

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/Kconfig
fs/btrfs/bio.c
fs/btrfs/fs.h
fs/btrfs/send.h
fs/btrfs/super.c
fs/btrfs/sysfs.c
fs/btrfs/volumes.h

index 4fb925e8c981d8f4fcf6ab61d72475c1ec68fb4c..fa8515598341ec16530abd1d8bf3438039d6b51f 100644 (file)
@@ -78,6 +78,32 @@ config BTRFS_ASSERT
 
          If unsure, say N.
 
+config BTRFS_EXPERIMENTAL
+       bool "Btrfs experimental features"
+       depends on BTRFS_FS
+       default n
+       help
+         Enable experimental features.  These features may not be stable enough
+         for end users.  This is meant for btrfs developers or users who wish
+         to test the functionality and report problems.
+
+         Current list:
+
+         - extent map shrinker - performance problems with too frequent shrinks
+
+         - send stream protocol v3 - fs-verity support
+
+         - checksum offload mode - sysfs knob to affect when checksums are
+                                   calculated (at IO time, or in a thread)
+
+         - raid-stripe-tree - additional mapping of extents to devices to
+                              support RAID1* profiles on zoned devices,
+                              RAID56 not yet supported
+
+         - extent tree v2 - complex rework of extent tracking
+
+         If unsure, say N.
+
 config BTRFS_FS_REF_VERIFY
        bool "Btrfs with the ref verify tool compiled in"
        depends on BTRFS_FS
index 7e0f9600b80c43647c3fac55ddab013b510c2ad8..1f216d07eff65c98d67c700811f264e1aa5be08c 100644 (file)
@@ -587,7 +587,7 @@ static bool should_async_write(struct btrfs_bio *bbio)
 {
        bool auto_csum_mode = true;
 
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
        struct btrfs_fs_devices *fs_devices = bbio->fs_info->fs_devices;
        enum btrfs_offload_csum_mode csum_mode = READ_ONCE(fs_devices->offload_csum_mode);
 
index cbfb225858a59faa95ca25a6193b224dba23b0ef..785ec15c1b849b7ad135fb35401e8692b3026bef 100644 (file)
@@ -263,10 +263,10 @@ enum {
         BTRFS_FEATURE_INCOMPAT_ZONED           |       \
         BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA)
 
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
        /*
         * Features under developmen like Extent tree v2 support is enabled
-        * only under CONFIG_BTRFS_DEBUG.
+        * only under CONFIG_BTRFS_EXPERIMENTAL
         */
 #define BTRFS_FEATURE_INCOMPAT_SUPP            \
        (BTRFS_FEATURE_INCOMPAT_SUPP_STABLE |   \
index b07f4aa6687836f95e9361e0cabd743a1a12b90a..9309886c5ea17b1fdd050eff86a0475bb21d9a5e 100644 (file)
@@ -16,7 +16,7 @@ struct btrfs_ioctl_send_args;
 
 #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
 /* Conditional support for the upcoming protocol version. */
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
 #define BTRFS_SEND_STREAM_VERSION 3
 #else
 #define BTRFS_SEND_STREAM_VERSION 2
index c64d071341223100fc2cd4a5a3d0c373b85e9bc0..029e2bb4466bf9081ad2b47548ce70600d4798a9 100644 (file)
@@ -2396,10 +2396,10 @@ static long btrfs_nr_cached_objects(struct super_block *sb, struct shrink_contro
        trace_btrfs_extent_map_shrinker_count(fs_info, nr);
 
        /*
-        * Only report the real number for DEBUG builds, as there are reports of
-        * serious performance degradation caused by too frequent shrinks.
+        * Only report the real number for EXPERIMENTAL builds, as there are
+        * reports of serious performance degradation caused by too frequent shrinks.
         */
-       if (IS_ENABLED(CONFIG_BTRFS_DEBUG))
+       if (IS_ENABLED(CONFIG_BTRFS_EXPERIMENTAL))
                return nr;
        return 0;
 }
index 03926ad467c919f7beae95f7c66f9c76496773c8..b843308e2bc6f6d23b58e0c6a75f8b2292d9b4b5 100644 (file)
@@ -1390,7 +1390,7 @@ static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj,
 BTRFS_ATTR_RW(, bg_reclaim_threshold, btrfs_bg_reclaim_threshold_show,
              btrfs_bg_reclaim_threshold_store);
 
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
 static ssize_t btrfs_offload_csum_show(struct kobject *kobj,
                                       struct kobj_attribute *a, char *buf)
 {
@@ -1450,7 +1450,7 @@ static const struct attribute *btrfs_attrs[] = {
        BTRFS_ATTR_PTR(, bg_reclaim_threshold),
        BTRFS_ATTR_PTR(, commit_stats),
        BTRFS_ATTR_PTR(, temp_fsid),
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
        BTRFS_ATTR_PTR(, offload_csum),
 #endif
        NULL,
index 4481575dd70f354b211b32ab589f81a3f52b8476..26e35fc1c8fdab7d0770868fa73b6645e299f353 100644 (file)
@@ -306,7 +306,7 @@ enum btrfs_read_policy {
        BTRFS_NR_READ_POLICY,
 };
 
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
 /*
  * Checksum mode - offload it to workqueues or do it synchronously in
  * btrfs_submit_chunk().
@@ -430,7 +430,7 @@ struct btrfs_fs_devices {
        /* Policy used to read the mirrored stripes. */
        enum btrfs_read_policy read_policy;
 
-#ifdef CONFIG_BTRFS_DEBUG
+#ifdef CONFIG_BTRFS_EXPERIMENTAL
        /* Checksum mode - offload it or do it synchronously. */
        enum btrfs_offload_csum_mode offload_csum_mode;
 #endif