All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <i@coly.li>
To: bcache@lists.ewheeler.net
Cc: linux-block@vger.kernel.org, linux-bcache@vger.kernel.org,
	hch@infradead.org, axboe@kernel.dk,
	Eric Wheeler <git@linux.ewheeler.net>,
	Eric Wheeler <bcache@linux.ewheeler.net>
Subject: Re: [PATCH 09/19] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints
Date: Sun, 2 Jul 2017 02:49:20 +0800	[thread overview]
Message-ID: <f9976cdb-dcff-ac98-9a18-2d06b2d4c475@coly.li> (raw)
In-Reply-To: <1498855388-16990-9-git-send-email-bcache@lists.ewheeler.net>

On 2017/7/1 上午4:42, bcache@lists.ewheeler.net wrote:
> From: Eric Wheeler <git@linux.ewheeler.net>
> 
> Bypass if:     bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND)
> 
> Writeback if:  op_is_sync(bio->bi_opf) || bio->bi_opf & (REQ_META|REQ_PRIO)
> 

Hi Eric,

Could you please explain a bit how the above policy is designed ? I'd
like to understand it more.

Thanks.

Coly


> Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net>
> ---
>  drivers/md/bcache/request.c   | 3 +++
>  drivers/md/bcache/writeback.h | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
> index a95609f..4629b0c 100644
> --- a/drivers/md/bcache/request.c
> +++ b/drivers/md/bcache/request.c
> @@ -386,6 +386,9 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
>  	     op_is_write(bio_op(bio))))
>  		goto skip;
>  
> +	if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND))
> +		goto skip;
> +
>  	/* If the ioprio already exists on the bio, use that.  We assume that
>  	 * the upper layer properly assigned the calling process's ioprio to
>  	 * the bio being passed to bcache. Otherwise, use current's ioc. */
> diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h
> index cd82fe8..ea2f92e 100644
> --- a/drivers/md/bcache/writeback.h
> +++ b/drivers/md/bcache/writeback.h
> @@ -81,7 +81,8 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
>  		return true;
>  	}
>  
> -	return op_is_sync(bio->bi_opf) || in_use <= CUTOFF_WRITEBACK;
> +	return op_is_sync(bio->bi_opf) || bio->bi_opf & (REQ_META|REQ_PRIO)
> +		|| in_use <= CUTOFF_WRITEBACK;
>  }
>  
>  static inline void bch_writeback_queue(struct cached_dev *dc)
> 

  reply	other threads:[~2017-07-01 18:49 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 19:10 [PULL] bcache updates based on git.kernel.dk/linux-block:for-next Eric Wheeler
2017-06-28 23:06 ` [PULL] bcache fixes and updates for-4.13 Eric Wheeler
2017-06-28 23:06   ` Eric Wheeler
2017-06-29 13:45   ` Christoph Hellwig
2016-10-11 19:04     ` [PATCH 07/19] bcache: introduce bcache sysfs entries for ioprio-based bypass/writeback hints Eric Wheeler
2016-10-11 19:04     ` Eric Wheeler
2016-10-11 19:08     ` [PATCH 08/19] bcache: documentation for sysfs entries describing bcache cache hinting Eric Wheeler
2016-10-11 19:08     ` Eric Wheeler
2016-10-20  0:36     ` [PATCH 09/19] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints Eric Wheeler
2016-10-20  0:36     ` Eric Wheeler
2017-05-09 19:03     ` [PATCH 01/19] bcache: Fix leak of bdev reference Jan Kara
2017-05-09 19:03     ` Jan Kara
2017-05-09 19:05     ` [PATCH 02/19] bcache: fix sequential large write IO bypass Tang Junhui
2017-05-09 19:05     ` Tang Junhui
2017-05-09 19:07     ` [PATCH 03/19] bcache: do not subtract sectors_to_gc for bypassed IO Tang Junhui
2017-05-09 19:07     ` Tang Junhui
2017-05-09 19:14     ` [PATCH 05/19] bcache: fix calling ida_simple_remove() with incorrect minor Tang Junhui
2017-05-09 19:14     ` Tang Junhui
2017-06-01  8:48     ` [PATCH 10/19] bcache: initialize stripe_sectors_dirty correctly for thin flash device Tang Junhui
2017-06-01  8:48     ` Tang Junhui
2017-06-12 21:18     ` [PATCH 14/19] bcache: Correct return value for sysfs attach errors Tony Asleson
2017-06-12 21:18     ` Tony Asleson
2017-06-28  0:30     ` [PATCH 13/19] bcache: delete redundant calling set_gc_sectors() Tang Junhui
2017-06-28  0:30     ` Tang Junhui
2017-06-28  0:37     ` [PATCH 16/19] bcache: increase the number of open buckets Tang Junhui
2017-06-28  0:37     ` Tang Junhui
2017-06-28  0:41     ` [PATCH 17/19] bcache: fix for gc and write-back race Tang Junhui
2017-06-28  0:41     ` Tang Junhui
2017-06-28 11:47     ` [PATCH 18/19] bcache: silence static checker warning Dan Carpenter
2017-06-28 11:47     ` Dan Carpenter
2017-06-28 11:48     ` [PATCH 19/19] bcache: Update continue_at() documentation Dan Carpenter
2017-06-28 11:48     ` Dan Carpenter
2017-06-29 16:19     ` [PULL] bcache fixes and updates for-4.13 Coly Li
2017-06-29 22:12     ` Eric Wheeler
2017-06-29 22:12       ` Eric Wheeler
2017-06-29 22:25       ` Eric Wheeler
2017-06-29 23:28         ` Nick Alcock
2017-06-30 20:42     ` [PATCH 01/19] bcache: Fix leak of bdev reference bcache
2017-06-30 20:42       ` [PATCH 02/19] bcache: fix sequential large write IO bypass bcache
2017-07-05 18:25         ` Christoph Hellwig
2017-06-30 20:42       ` [PATCH 03/19] bcache: do not subtract sectors_to_gc for bypassed IO bcache
2017-07-01 17:26         ` Coly Li
2017-07-05 18:25         ` Christoph Hellwig
2017-06-30 20:42       ` [PATCH 04/19] bcache: fix wrong cache_misses statistics bcache
2017-07-01 17:58         ` Coly Li
2017-07-13  4:09           ` Eric Wheeler
2017-10-27 19:14             ` Eric Wheeler
2017-06-30 20:42       ` [PATCH 05/19] bcache: fix calling ida_simple_remove() with incorrect minor bcache
2017-07-05 18:26         ` Christoph Hellwig
2017-07-06  6:21           ` tang.junhui
2017-06-30 20:42       ` [PATCH 06/19] bcache: explicitly destory mutex while exiting bcache
2017-07-01 18:43         ` Coly Li
2017-07-05 11:58           ` Liang Chen
2017-07-05 11:58             ` Liang Chen
2017-07-11  7:22             ` Coly Li
2017-07-05 18:27         ` Christoph Hellwig
2017-07-06  1:56           ` Liang Chen
2017-06-30 20:42       ` [PATCH 07/19] bcache: introduce bcache sysfs entries for ioprio-based bypass/writeback hints bcache
2017-07-05 18:47         ` Christoph Hellwig
2017-07-05 21:49           ` Eric Wheeler
2017-06-30 20:42       ` [PATCH 08/19] bcache: documentation for sysfs entries describing bcache cache hinting bcache
2017-07-05 18:27         ` Christoph Hellwig
2017-06-30 20:42       ` [PATCH 09/19] bcache: update bio->bi_opf bypass/writeback REQ_ flag hints bcache
2017-07-01 18:49         ` Coly Li [this message]
2017-07-01 19:39           ` Eric Wheeler
2017-07-02  6:51             ` Coly Li
2017-07-03 22:51               ` [PATCH 09/19 v2] " bcache
2017-07-04  4:08                 ` Coly Li
2017-07-05 18:48                 ` Christoph Hellwig
2017-07-06  7:35                   ` Coly Li
2017-07-06 15:24                     ` Christoph Hellwig
2017-07-11  3:48                       ` Coly Li
2017-07-12  9:18                         ` Coly Li
2017-06-30 20:42       ` [PATCH 10/19] bcache: initialize stripe_sectors_dirty correctly for thin flash device bcache
2017-07-01 18:52         ` Coly Li
2017-07-13  4:10           ` Eric Wheeler
2017-06-30 20:43       ` [PATCH 11/19] bcache: Subtract dirty sectors of thin flash from cache_sectors in calculating writeback rate bcache
2017-07-10 18:11         ` Coly Li
     [not found]           ` <OF92BDA950.86AA00FA-ON4825815A.001F33D9-4825815A.001F5C89@zte.com.cn>
2017-07-13  4:12             ` Eric Wheeler
2017-07-13  4:15               ` Coly Li
2017-10-27 19:12                 ` Eric Wheeler
2017-06-30 20:43       ` [PATCH 12/19] bcache: update bucket_in_use periodically bcache
2017-07-11  5:05         ` Coly Li
     [not found]           ` <OF5C19A8FA.5FF48E0C-ON4825815A.001E6DB1-4825815A.001F14F2@zte.com.cn>
2017-07-11  7:20             ` Coly Li
2017-07-11 13:06             ` Coly Li
2017-07-13  4:13               ` Eric Wheeler
2017-07-13  4:27                 ` Coly Li
2017-10-27 19:11                   ` Eric Wheeler
2017-10-27 19:45                     ` Eric Wheeler
2017-06-30 20:43       ` [PATCH 13/19] bcache: delete redundant calling set_gc_sectors() bcache
2017-07-13  3:41         ` Eric Wheeler
2017-06-30 20:43       ` [PATCH 14/19] bcache: Correct return value for sysfs attach errors bcache
2017-06-30 20:43       ` [PATCH 15/19] bcache: fix issue of writeback rate at minimum 1 key per second bcache
2017-07-16 10:04         ` Coly Li
2017-10-27 19:07           ` Eric Wheeler
2017-10-27 19:09             ` Eric Wheeler
2017-10-28  8:58               ` Coly Li
2017-06-30 20:43       ` [PATCH 16/19] bcache: increase the number of open buckets bcache
2017-06-30 20:43         ` bcache
2017-07-13  9:56         ` Coly Li
2017-06-30 20:43       ` [PATCH 17/19] bcache: fix for gc and write-back race bcache
2017-08-03 16:20         ` Coly Li
2017-06-30 20:43       ` [PATCH 18/19] bcache: silence static checker warning bcache
2017-07-13  9:44         ` Coly Li
2017-06-30 20:43       ` [PATCH 19/19] bcache: Update continue_at() documentation bcache
2017-07-05 18:48         ` Christoph Hellwig
2017-07-08 18:12         ` Coly Li
2017-07-01 16:55       ` [PATCH 01/19] bcache: Fix leak of bdev reference Coly Li
2017-07-05 18:24       ` Christoph Hellwig
2017-09-04 17:30         ` Coly Li
2017-09-05  6:43           ` Christoph Hellwig
2017-09-05  6:55             ` Coly Li
2017-09-06  5:25             ` Coly Li
2017-07-14 11:40 ` [PULL] bcache updates based on git.kernel.dk/linux-block:for-next Eddie Chapman
2017-07-14 15:07   ` Coly Li
2017-07-14 17:33     ` Eddie Chapman
     [not found]       ` <OF92BA0158.87BDF9E3-ON4825815E.000736BF-4825815E.000833F7@zte.com.cn>
2017-07-18 18:24         ` Eddie Chapman
2017-07-18 18:31           ` Eddie Chapman
2017-07-18 20:06             ` Greg KH
2017-07-18 20:36               ` Eddie Chapman

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=f9976cdb-dcff-ac98-9a18-2d06b2d4c475@coly.li \
    --to=i@coly.li \
    --cc=axboe@kernel.dk \
    --cc=bcache@linux.ewheeler.net \
    --cc=bcache@lists.ewheeler.net \
    --cc=git@linux.ewheeler.net \
    --cc=hch@infradead.org \
    --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.