All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>
Subject: [PATCH 11/12] bcache: set writeback_percent in a flexible range
Date: Thu, 13 Dec 2018 22:53:56 +0800	[thread overview]
Message-ID: <20181213145357.38528-12-colyli@suse.de> (raw)
In-Reply-To: <20181213145357.38528-1-colyli@suse.de>

Because CUTOFF_WRITEBACK is defined as 40, so before the changes of
dynamic cutoff writeback values, writeback_percent is limited to
[0, CUTOFF_WRITEBACK]. Any value larger than CUTOFF_WRITEBACK will
be fixed up to 40.

Now cutof writeback limit is a dynamic value bch_cutoff_writeback,
so the range of writeback_percent can be a more flexible range as
[0, bch_cutoff_writeback]. The flexibility is, it can be expended
to a larger or smaller range than [0, 40], depends on how value
bch_cutoff_writeback is specified.

The default value is still strongly recommended to most of users for
most of workloads. But for people who want to do research on bcache
writeback perforamnce tuning, they may have chance to specify more
flexible writeback_percent in range [0, 70].

Signed-off-by: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 482b128b3e9d..557a8a3270a1 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -267,7 +267,8 @@ STORE(__cached_dev)
 	d_strtoul(writeback_running);
 	d_strtoul(writeback_delay);
 
-	sysfs_strtoul_clamp(writeback_percent, dc->writeback_percent, 0, 40);
+	sysfs_strtoul_clamp(writeback_percent, dc->writeback_percent,
+			    0, bch_cutoff_writeback);
 
 	if (attr == &sysfs_writeback_rate) {
 		ssize_t ret;
-- 
2.16.4


  parent reply	other threads:[~2018-12-13 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 14:53 [PATCH 00/12] bcache patches for Linux v4.21 Coly Li
2018-12-13 14:53 ` [PATCH 01/12] bcache: add comment for cache_set->fill_iter Coly Li
2018-12-13 14:53 ` [PATCH 02/12] bcache: do not check if debug dentry is ERR or NULL explicitly on remove Coly Li
2018-12-13 14:53 ` [PATCH 03/12] bcache: update comment for bch_data_insert Coly Li
2018-12-13 14:53 ` [PATCH 04/12] bcache: update comment in sysfs.c Coly Li
2018-12-13 14:53 ` [PATCH 05/12] bcache: do not mark writeback_running until backing dev attached to cache_set Coly Li
2018-12-13 14:53 ` [PATCH 06/12] bcache: cannot set writeback_running via sysfs if no writeback kthread created Coly Li
2018-12-13 14:53 ` [PATCH 07/12] bcache: introduce force_wake_up_gc() Coly Li
2018-12-13 14:53 ` [PATCH 08/12] bcache: option to automatically run gc thread after writeback accomplished Coly Li
2018-12-13 14:53 ` [PATCH 09/12] bcache: add MODULE_DESCRIPTION information Coly Li
2018-12-13 14:53 ` [PATCH 10/12] bcache: make cutoff_writeback and cutoff_writeback_sync tunnable Coly Li
2018-12-13 14:53 ` Coly Li [this message]
2018-12-13 14:53 ` [PATCH 12/12] bcache: print number of keys in trace_bcache_journal_write Coly Li
2018-12-13 15:16 ` [PATCH 00/12] bcache patches for Linux v4.21 Jens Axboe
2018-12-14  8:25   ` Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181213145357.38528-12-colyli@suse.de \
    --to=colyli@suse.de \
    --cc=axboe@kernel.dk \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.