* [PATCH] bcache: make writeback_cutoff and writeback_cutoff_sync writeable
@ 2020-11-05 14:19 Dongdong Tao
2020-11-05 14:23 ` Coly Li
0 siblings, 1 reply; 3+ messages in thread
From: Dongdong Tao @ 2020-11-05 14:19 UTC (permalink / raw)
To: colyli
Cc: dongdong.tao, Kent Overstreet,
open list:BCACHE (BLOCK LAYER CACHE),
open list
From: dongdong tao <dongdong.tao@canonical.com>
commit 9aaf51654672 ("bcache: make cutoff_writeback and
cutoff_writeback_sync tunable") intend to make these two option
configurable by user, but these two are still read-only.
Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
---
drivers/md/bcache/sysfs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 554e3afc9b68..81f4a681705c 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -102,8 +102,8 @@ read_attribute(writeback_keys_done);
read_attribute(writeback_keys_failed);
read_attribute(io_errors);
read_attribute(congested);
-read_attribute(cutoff_writeback);
-read_attribute(cutoff_writeback_sync);
+rw_attribute(cutoff_writeback);
+rw_attribute(cutoff_writeback_sync);
rw_attribute(congested_read_threshold_us);
rw_attribute(congested_write_threshold_us);
@@ -902,6 +902,8 @@ STORE(__bch_cache_set)
sysfs_strtoul_bool(copy_gc_enabled, c->copy_gc_enabled);
sysfs_strtoul_bool(idle_max_writeback_rate,
c->idle_max_writeback_rate_enabled);
+ sysfs_strtoul_clamp(cutoff_writeback, bch_cutoff_writeback, 1, 100);
+ sysfs_strtoul_clamp(cutoff_writeback_sync, bch_cutoff_writeback_sync, 1, 100);
/*
* write gc_after_writeback here may overwrite an already set
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] bcache: make writeback_cutoff and writeback_cutoff_sync writeable
2020-11-05 14:19 [PATCH] bcache: make writeback_cutoff and writeback_cutoff_sync writeable Dongdong Tao
@ 2020-11-05 14:23 ` Coly Li
2020-11-05 14:35 ` 陶冬冬
0 siblings, 1 reply; 3+ messages in thread
From: Coly Li @ 2020-11-05 14:23 UTC (permalink / raw)
To: Dongdong Tao
Cc: dongdong.tao, Kent Overstreet,
open list:BCACHE (BLOCK LAYER CACHE),
open list
On 2020/11/5 22:19, Dongdong Tao wrote:
> From: dongdong tao <dongdong.tao@canonical.com>
>
> commit 9aaf51654672 ("bcache: make cutoff_writeback and
> cutoff_writeback_sync tunable") intend to make these two option
> configurable by user, but these two are still read-only.
>
> Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
> ---
> drivers/md/bcache/sysfs.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> index 554e3afc9b68..81f4a681705c 100644
> --- a/drivers/md/bcache/sysfs.c
> +++ b/drivers/md/bcache/sysfs.c
> @@ -102,8 +102,8 @@ read_attribute(writeback_keys_done);
> read_attribute(writeback_keys_failed);
> read_attribute(io_errors);
> read_attribute(congested);
> -read_attribute(cutoff_writeback);
> -read_attribute(cutoff_writeback_sync);
> +rw_attribute(cutoff_writeback);
> +rw_attribute(cutoff_writeback_sync);
> rw_attribute(congested_read_threshold_us);
> rw_attribute(congested_write_threshold_us);
>
> @@ -902,6 +902,8 @@ STORE(__bch_cache_set)
> sysfs_strtoul_bool(copy_gc_enabled, c->copy_gc_enabled);
> sysfs_strtoul_bool(idle_max_writeback_rate,
> c->idle_max_writeback_rate_enabled);
> + sysfs_strtoul_clamp(cutoff_writeback, bch_cutoff_writeback, 1, 100);
> + sysfs_strtoul_clamp(cutoff_writeback_sync, bch_cutoff_writeback_sync, 1, 100);
>
NACK, we only support the default value. Commit 9aaf51654672 ("bcache:
make cutoff_writeback and cutoff_writeback_sync tunable") clearly
announced the purpose was for research and experiment.
Coly Li
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] bcache: make writeback_cutoff and writeback_cutoff_sync writeable
2020-11-05 14:23 ` Coly Li
@ 2020-11-05 14:35 ` 陶冬冬
0 siblings, 0 replies; 3+ messages in thread
From: 陶冬冬 @ 2020-11-05 14:35 UTC (permalink / raw)
To: Coly Li
Cc: dongdong tao, Kent Overstreet,
open list:BCACHE (BLOCK LAYER CACHE),
open list
Ah, I missed the second part, only saw the first paragraph.
But I kind of hope it can be configurable :)
Anyway, thanks for the clarification.
Coly Li <colyli@suse.de> 于2020年11月5日周四 下午10:23写道:
>
> On 2020/11/5 22:19, Dongdong Tao wrote:
> > From: dongdong tao <dongdong.tao@canonical.com>
> >
> > commit 9aaf51654672 ("bcache: make cutoff_writeback and
> > cutoff_writeback_sync tunable") intend to make these two option
> > configurable by user, but these two are still read-only.
> >
> > Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
> > ---
> > drivers/md/bcache/sysfs.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> > index 554e3afc9b68..81f4a681705c 100644
> > --- a/drivers/md/bcache/sysfs.c
> > +++ b/drivers/md/bcache/sysfs.c
> > @@ -102,8 +102,8 @@ read_attribute(writeback_keys_done);
> > read_attribute(writeback_keys_failed);
> > read_attribute(io_errors);
> > read_attribute(congested);
> > -read_attribute(cutoff_writeback);
> > -read_attribute(cutoff_writeback_sync);
> > +rw_attribute(cutoff_writeback);
> > +rw_attribute(cutoff_writeback_sync);
> > rw_attribute(congested_read_threshold_us);
> > rw_attribute(congested_write_threshold_us);
> >
> > @@ -902,6 +902,8 @@ STORE(__bch_cache_set)
> > sysfs_strtoul_bool(copy_gc_enabled, c->copy_gc_enabled);
> > sysfs_strtoul_bool(idle_max_writeback_rate,
> > c->idle_max_writeback_rate_enabled);
> > + sysfs_strtoul_clamp(cutoff_writeback, bch_cutoff_writeback, 1, 100);
> > + sysfs_strtoul_clamp(cutoff_writeback_sync, bch_cutoff_writeback_sync, 1, 100);
> >
>
> NACK, we only support the default value. Commit 9aaf51654672 ("bcache:
> make cutoff_writeback and cutoff_writeback_sync tunable") clearly
> announced the purpose was for research and experiment.
>
> Coly Li
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-05 14:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 14:19 [PATCH] bcache: make writeback_cutoff and writeback_cutoff_sync writeable Dongdong Tao
2020-11-05 14:23 ` Coly Li
2020-11-05 14:35 ` 陶冬冬
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®