* [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG
@ 2024-09-16 9:05 Qu Wenruo
2024-09-16 9:05 ` [PATCH 1/2] btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG Qu Wenruo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Qu Wenruo @ 2024-09-16 9:05 UTC (permalink / raw)
To: linux-btrfs
The first patch is to make it more consistent for assert_rbio() to
follow the CONFIG_BTRFS_ASSERT.
Then the second patch split out the following features into the new
CONFIG_BTRFS_EXPERIMENTAL:
- Extent map shrinker
- Extent tree v2
- Raid stripe tree
- Csum offload mode
- Send string v3
This is mostly to make those features to get more attention, and
eventually to move into stable features.
So far I think csum offload mode and extent map shrinker are strong
candidates, and later sector perfect compression will also join the
experimental features.
Qu Wenruo (2):
btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG
btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG
fs/btrfs/Kconfig | 9 +++++++++
fs/btrfs/bio.c | 2 +-
fs/btrfs/fs.h | 4 ++--
fs/btrfs/raid56.c | 3 +--
fs/btrfs/send.h | 2 +-
fs/btrfs/super.c | 6 +++---
fs/btrfs/sysfs.c | 4 ++--
fs/btrfs/volumes.h | 4 ++--
8 files changed, 21 insertions(+), 13 deletions(-)
--
2.46.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG 2024-09-16 9:05 [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo @ 2024-09-16 9:05 ` Qu Wenruo 2024-09-16 9:05 ` [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 10:58 ` [PATCH 0/2] " Johannes Thumshirn 2 siblings, 0 replies; 5+ messages in thread From: Qu Wenruo @ 2024-09-16 9:05 UTC (permalink / raw) To: linux-btrfs According to the description, CONFIG_BTRFS_DEBUG is only for extra debug info, meanwhile sanity checks should be managed by CONFIG_BTRFS_ASSERT. There is no need to check both to enable assert_rbio(). Just remove the check for CONFIG_BTRFS_DEBUG. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/raid56.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 39bec672df0c..cdd373c27784 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1272,8 +1272,7 @@ static inline void bio_list_put(struct bio_list *bio_list) static void assert_rbio(struct btrfs_raid_bio *rbio) { - if (!IS_ENABLED(CONFIG_BTRFS_DEBUG) || - !IS_ENABLED(CONFIG_BTRFS_ASSERT)) + if (!IS_ENABLED(CONFIG_BTRFS_ASSERT)) return; /* -- 2.46.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG 2024-09-16 9:05 [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 9:05 ` [PATCH 1/2] btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG Qu Wenruo @ 2024-09-16 9:05 ` Qu Wenruo 2024-09-17 16:57 ` Filipe Manana 2024-09-16 10:58 ` [PATCH 0/2] " Johannes Thumshirn 2 siblings, 1 reply; 5+ messages in thread From: Qu Wenruo @ 2024-09-16 9:05 UTC (permalink / raw) To: linux-btrfs 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 debug. This patch will split 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 string v3 Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/Kconfig | 9 +++++++++ fs/btrfs/bio.c | 2 +- fs/btrfs/fs.h | 4 ++-- fs/btrfs/send.h | 2 +- fs/btrfs/super.c | 6 +++--- fs/btrfs/sysfs.c | 4 ++-- fs/btrfs/volumes.h | 4 ++-- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig index 4fb925e8c981..ead317f1eeb8 100644 --- a/fs/btrfs/Kconfig +++ b/fs/btrfs/Kconfig @@ -78,6 +78,15 @@ config BTRFS_ASSERT If unsure, say N. +config BTRFS_EXPERIMENTAL + bool "Btrfs experimental features" + depends on BTRFS_FS + help + Enable experimental features. These features may not be stable enough + for end users. This is meant for btrfs developers only. + + If unsure, say N. + config BTRFS_FS_REF_VERIFY bool "Btrfs with the ref verify tool compiled in" depends on BTRFS_FS diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index ce13416bc10f..056f8a171bba 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -605,7 +605,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); diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h index cbfb225858a5..785ec15c1b84 100644 --- a/fs/btrfs/fs.h +++ b/fs/btrfs/fs.h @@ -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 | \ diff --git a/fs/btrfs/send.h b/fs/btrfs/send.h index b07f4aa66878..9309886c5ea1 100644 --- a/fs/btrfs/send.h +++ b/fs/btrfs/send.h @@ -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 diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 98fa0f382480..e8a5bf4af918 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2403,10 +2403,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; } diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 03926ad467c9..b843308e2bc6 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -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, diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 03d2d60afe0c..c207c94a4a5e 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -300,7 +300,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(). @@ -424,7 +424,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 -- 2.46.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG 2024-09-16 9:05 ` [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo @ 2024-09-17 16:57 ` Filipe Manana 0 siblings, 0 replies; 5+ messages in thread From: Filipe Manana @ 2024-09-17 16:57 UTC (permalink / raw) To: Qu Wenruo; +Cc: linux-btrfs On Mon, Sep 16, 2024 at 10:06 AM Qu Wenruo <wqu@suse.com> wrote: > > 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 debug. > > This patch will split 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 string v3 string -> stream Also this change is breaking fstests btrfs/304 to 308 if CONFIG_BTRFS_EXPERIMENTAL is not set. That's because sysfs is still exposing the raid_stripe_tree and extent_tree_v2 under a #ifdef CONFIG_BTRFS_DEBUG. Thanks. > > Signed-off-by: Qu Wenruo <wqu@suse.com> > --- > fs/btrfs/Kconfig | 9 +++++++++ > fs/btrfs/bio.c | 2 +- > fs/btrfs/fs.h | 4 ++-- > fs/btrfs/send.h | 2 +- > fs/btrfs/super.c | 6 +++--- > fs/btrfs/sysfs.c | 4 ++-- > fs/btrfs/volumes.h | 4 ++-- > 7 files changed, 20 insertions(+), 11 deletions(-) > > diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig > index 4fb925e8c981..ead317f1eeb8 100644 > --- a/fs/btrfs/Kconfig > +++ b/fs/btrfs/Kconfig > @@ -78,6 +78,15 @@ config BTRFS_ASSERT > > If unsure, say N. > > +config BTRFS_EXPERIMENTAL > + bool "Btrfs experimental features" > + depends on BTRFS_FS > + help > + Enable experimental features. These features may not be stable enough > + for end users. This is meant for btrfs developers only. > + > + If unsure, say N. > + > config BTRFS_FS_REF_VERIFY > bool "Btrfs with the ref verify tool compiled in" > depends on BTRFS_FS > diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c > index ce13416bc10f..056f8a171bba 100644 > --- a/fs/btrfs/bio.c > +++ b/fs/btrfs/bio.c > @@ -605,7 +605,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); > > diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h > index cbfb225858a5..785ec15c1b84 100644 > --- a/fs/btrfs/fs.h > +++ b/fs/btrfs/fs.h > @@ -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 | \ > diff --git a/fs/btrfs/send.h b/fs/btrfs/send.h > index b07f4aa66878..9309886c5ea1 100644 > --- a/fs/btrfs/send.h > +++ b/fs/btrfs/send.h > @@ -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 > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > index 98fa0f382480..e8a5bf4af918 100644 > --- a/fs/btrfs/super.c > +++ b/fs/btrfs/super.c > @@ -2403,10 +2403,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; > } > diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c > index 03926ad467c9..b843308e2bc6 100644 > --- a/fs/btrfs/sysfs.c > +++ b/fs/btrfs/sysfs.c > @@ -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, > diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h > index 03d2d60afe0c..c207c94a4a5e 100644 > --- a/fs/btrfs/volumes.h > +++ b/fs/btrfs/volumes.h > @@ -300,7 +300,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(). > @@ -424,7 +424,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 > -- > 2.46.0 > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG 2024-09-16 9:05 [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 9:05 ` [PATCH 1/2] btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 9:05 ` [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo @ 2024-09-16 10:58 ` Johannes Thumshirn 2 siblings, 0 replies; 5+ messages in thread From: Johannes Thumshirn @ 2024-09-16 10:58 UTC (permalink / raw) To: WenRuo Qu, linux-btrfs@vger.kernel.org Looks good to me, Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-17 16:57 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-09-16 9:05 [PATCH 0/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 9:05 ` [PATCH 1/2] btrfs: make assert_rbio() to only check CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-16 9:05 ` [PATCH 2/2] btrfs: split out CONFIG_BTRFS_EXPERIMENTAL from CONFIG_BTRFS_DEBUG Qu Wenruo 2024-09-17 16:57 ` Filipe Manana 2024-09-16 10:58 ` [PATCH 0/2] " Johannes Thumshirn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox