public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Kent Overstreet <kent.overstreet@gmail.com>
To: Michael Lyle <mlyle@lyle.org>
Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
	colyli@suse.de
Subject: Re: [PATCH v2 2/2] bcache: rearrange writeback main thread ratelimit
Date: Fri, 13 Oct 2017 19:20:13 -0400	[thread overview]
Message-ID: <20171013232013.5bm4h5seuxhj7k25@kmo-pixel> (raw)
In-Reply-To: <20171009073730.8939-3-mlyle@lyle.org>

On Mon, Oct 09, 2017 at 12:37:30AM -0700, Michael Lyle wrote:
> The time spent searching for things to write back "counts" for the
> actual rate achieved, so don't flush the accumulated rate with each
> chunk.
> 
> This will maintain better fidelity to user-commanded rates, but it
> may slightly increase the burstiness of writeback.  The writeback
> lock needs improvement to help mitigate this.
> 
> Signed-off-by: Michael Lyle <mlyle@lyle.org>

Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>

> ---
>  drivers/md/bcache/writeback.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
> index 42d087b9fb56..719b104db0cc 100644
> --- a/drivers/md/bcache/writeback.c
> +++ b/drivers/md/bcache/writeback.c
> @@ -526,6 +526,8 @@ static int bch_writeback_thread(void *arg)
>  	struct cached_dev *dc = arg;
>  	bool searched_full_index;
>  
> +	bch_ratelimit_reset(&dc->writeback_rate);
> +
>  	while (!kthread_should_stop()) {
>  		down_write(&dc->writeback_lock);
>  		if (!atomic_read(&dc->has_dirty) ||
> @@ -553,7 +555,6 @@ static int bch_writeback_thread(void *arg)
>  
>  		up_write(&dc->writeback_lock);
>  
> -		bch_ratelimit_reset(&dc->writeback_rate);
>  		read_dirty(dc);
>  
>  		if (searched_full_index) {
> @@ -563,6 +564,8 @@ static int bch_writeback_thread(void *arg)
>  			       !kthread_should_stop() &&
>  			       !test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags))
>  				delay = schedule_timeout_interruptible(delay);
> +
> +			bch_ratelimit_reset(&dc->writeback_rate);
>  		}
>  	}
>  
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2017-10-13 23:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  7:37 (unknown), Michael Lyle
2017-10-09  7:37 ` [PATCH v2 1/2] bcache: writeback rate shouldn't artifically clamp Michael Lyle
2017-10-09 10:59   ` Coly Li
2017-10-09  7:37 ` [PATCH v2 2/2] bcache: rearrange writeback main thread ratelimit Michael Lyle
2017-10-13 23:20   ` Kent Overstreet [this message]

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=20171013232013.5bm4h5seuxhj7k25@kmo-pixel \
    --to=kent.overstreet@gmail.com \
    --cc=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mlyle@lyle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox