* [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose
@ 2023-03-13 7:46 Naohiro Aota
2023-03-13 8:44 ` Johannes Thumshirn
2023-03-14 17:45 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Naohiro Aota @ 2023-03-13 7:46 UTC (permalink / raw)
To: linux-btrfs; +Cc: Naohiro Aota
Currently, /sys/fs/btrfs/<UUID>/bg_reclaim_threshold is limited to 0
(disable) or [50 .. 100]%, so we need to fill 50% of a device to start the
auto reclaim process. It is cumbersome to do so when we want to shake out
possible race issues of normal write vs reclaim.
Relax the threshold check under the BTRFS_DEBUG option.
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
fs/btrfs/sysfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 37fc58a7f27e..25294e624851 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1262,8 +1262,13 @@ static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj,
if (ret)
return ret;
+#ifdef CONFIG_BTRFS_DEBUG
+ if (thresh != 0 && (thresh > 100))
+ return -EINVAL;
+#else
if (thresh != 0 && (thresh <= 50 || thresh > 100))
return -EINVAL;
+#endif
WRITE_ONCE(fs_info->bg_reclaim_threshold, thresh);
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose
2023-03-13 7:46 [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose Naohiro Aota
@ 2023-03-13 8:44 ` Johannes Thumshirn
2023-03-14 17:45 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2023-03-13 8:44 UTC (permalink / raw)
To: Naohiro Aota, linux-btrfs
On 13.03.23 08:47, Naohiro Aota wrote:
> Currently, /sys/fs/btrfs/<UUID>/bg_reclaim_threshold is limited to 0
> (disable) or [50 .. 100]%, so we need to fill 50% of a device to start the
> auto reclaim process. It is cumbersome to do so when we want to shake out
> possible race issues of normal write vs reclaim.
>
> Relax the threshold check under the BTRFS_DEBUG option.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Fine by me,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose
2023-03-13 7:46 [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose Naohiro Aota
2023-03-13 8:44 ` Johannes Thumshirn
@ 2023-03-14 17:45 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2023-03-14 17:45 UTC (permalink / raw)
To: Naohiro Aota; +Cc: linux-btrfs
On Mon, Mar 13, 2023 at 04:46:54PM +0900, Naohiro Aota wrote:
> Currently, /sys/fs/btrfs/<UUID>/bg_reclaim_threshold is limited to 0
> (disable) or [50 .. 100]%, so we need to fill 50% of a device to start the
> auto reclaim process. It is cumbersome to do so when we want to shake out
> possible race issues of normal write vs reclaim.
>
> Relax the threshold check under the BTRFS_DEBUG option.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-14 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 7:46 [PATCH] btrfs: relax bg_reclaim_threshold for debug purpose Naohiro Aota
2023-03-13 8:44 ` Johannes Thumshirn
2023-03-14 17:45 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.