From: Eric Wheeler <bcache@lists.ewheeler.net>
To: Coly Li <colyli@suse.de>
Cc: cluster-devel@redhat.com, swhiteho@redhat.com,
rpeterso@redhat.com, linux-bcache@vger.kernel.org
Subject: Re: [PATCH] [RFC] gfs2: add flag REQ_PRIO for metadata read ahead
Date: Tue, 11 Jul 2017 20:10:35 +0000 (UTC) [thread overview]
Message-ID: <alpine.LRH.2.11.1707112009490.10812@mail.ewheeler.net> (raw)
In-Reply-To: <20170711030902.13391-1-colyli@suse.de>
On Tue, 11 Jul 2017, Coly Li wrote:
> When gfs2 does metadata read ahead, currently flags (REQ_RAHEAD | REQ_META)
> are used to submit bio. Flag REQ_META is just a hint for block trace, not
> for block layer code to handle a bio as metadata request.
>
> When doing read ahead for metadata, A REQ_PRIO flag on the metadata bio
> is very informative to block layer code. For example, if bcache is used as
> a I/O cache for gfs2, it will be possible for bcache code to cache the
> pre-fetched metadata blocks on cache device as well, which may be
> probably to improve metadata I/O performance if the following requests
> hit the cache.
>
> This patch adds REQ_PRIO flag when submitting a metadata readahead bio.
> A meta data read ahead bio may come from I/O requests for bitmap,
> directoriesmeta or other general metadata request.
>
Are there any places in gfs2 where REQ_PRIO should be placed on
latency-sensitive metadata writes? They would then writeback in bcache
after the relevant bcache patch is merged.
--
Eric Wheeler
> Signed-off-by: Coly Li <colyli@suse.de>
> ---
> fs/gfs2/bmap.c | 5 +++--
> fs/gfs2/dir.c | 4 +++-
> fs/gfs2/meta_io.c | 4 +++-
> 3 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
> index 9fa3aef9a5b3..fa3ea29f39cf 100644
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -291,8 +291,9 @@ static void gfs2_metapath_ra(struct gfs2_glock *gl,
> if (trylock_buffer(rabh)) {
> if (!buffer_uptodate(rabh)) {
> rabh->b_end_io = end_buffer_read_sync;
> - submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META,
> - rabh);
> + submit_bh(REQ_OP_READ,
> + REQ_RAHEAD | REQ_META | REQ_PRIO,
> + rabh);
> continue;
> }
> unlock_buffer(rabh);
> diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
> index db427658ccd9..0741e4018f8c 100644
> --- a/fs/gfs2/dir.c
> +++ b/fs/gfs2/dir.c
> @@ -1514,7 +1514,9 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
> continue;
> }
> bh->b_end_io = end_buffer_read_sync;
> - submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META, bh);
> + submit_bh(REQ_OP_READ,
> + REQ_RAHEAD | REQ_META | REQ_PRIO,
> + bh);
> continue;
> }
> brelse(bh);
> diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
> index fabe1614f879..6103d1c816ef 100644
> --- a/fs/gfs2/meta_io.c
> +++ b/fs/gfs2/meta_io.c
> @@ -461,7 +461,9 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
> bh = gfs2_getbuf(gl, dblock, CREATE);
>
> if (!buffer_uptodate(bh) && !buffer_locked(bh))
> - ll_rw_block(REQ_OP_READ, REQ_RAHEAD | REQ_META, 1, &bh);
> + ll_rw_block(REQ_OP_READ,
> + REQ_RAHEAD | REQ_META | REQ_PRIO,
> + 1, &bh);
> brelse(bh);
> dblock++;
> extlen--;
> --
> 2.12.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
>
next prev parent reply other threads:[~2017-07-11 20:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 3:09 [PATCH] [RFC] gfs2: add flag REQ_PRIO for metadata read ahead Coly Li
2017-07-11 20:10 ` Eric Wheeler [this message]
2017-07-12 3:59 ` Coly Li
2017-07-19 16:05 ` Bob Peterson
2017-07-19 19:03 ` 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=alpine.LRH.2.11.1707112009490.10812@mail.ewheeler.net \
--to=bcache@lists.ewheeler.net \
--cc=cluster-devel@redhat.com \
--cc=colyli@suse.de \
--cc=linux-bcache@vger.kernel.org \
--cc=rpeterso@redhat.com \
--cc=swhiteho@redhat.com \
/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