From: Nick Piggin <npiggin@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/2] block: unify flags for struct bio and struct request
Date: Fri, 18 Jun 2010 19:07:53 +1000 [thread overview]
Message-ID: <20100618090753.GF6138@laptop> (raw)
In-Reply-To: <20100618074704.GB13358@lst.de>
On Fri, Jun 18, 2010 at 09:47:04AM +0200, Christoph Hellwig wrote:
> Remove the current bio flags and reuse the request flags for the bio, too.
> This allows to more easily trace the type of I/O from the filesystem
> down to the block driver. There were two flags in the bio that were
> missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've
> renamed two request flags that had a superflous RW in them.
>
> Note that the flags are in bio.h despite having the REQ_ name - as
> blkdev.h includes bio.h that is the only way to go for now.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6/block/blk-core.c
> ===================================================================
> --- linux-2.6.orig/block/blk-core.c 2010-06-17 13:21:18.000000000 +0200
> +++ linux-2.6/block/blk-core.c 2010-06-17 13:26:55.958005535 +0200
> @@ -1139,27 +1139,9 @@ void init_request_from_bio(struct reques
> {
> req->cpu = bio->bi_comp_cpu;
> req->cmd_type = REQ_TYPE_FS;
> -
> - /*
> - * Inherit FAILFAST from bio (for read-ahead, and explicit
> - * FAILFAST). FAILFAST flags are identical for req and bio.
> - */
> - if (bio_rw_flagged(bio, BIO_RW_AHEAD))
> + req->cmd_flags |= bio->bi_rw & REQ_COMMON_MASK;
> + if (bio->bi_rw & REQ_RAHEAD)
> req->cmd_flags |= REQ_FAILFAST_MASK;
> - else
> - req->cmd_flags |= bio->bi_rw & REQ_FAILFAST_MASK;
> -
> - if (bio_rw_flagged(bio, BIO_RW_DISCARD))
> - req->cmd_flags |= REQ_DISCARD;
> - if (bio_rw_flagged(bio, BIO_RW_BARRIER))
> - req->cmd_flags |= REQ_HARDBARRIER;
> - if (bio_rw_flagged(bio, BIO_RW_SYNCIO))
> - req->cmd_flags |= REQ_RW_SYNC;
> - if (bio_rw_flagged(bio, BIO_RW_META))
> - req->cmd_flags |= REQ_RW_META;
> - if (bio_rw_flagged(bio, BIO_RW_NOIDLE))
> - req->cmd_flags |= REQ_NOIDLE;
Much better for branches and icache.
Any reason not to make REQ_RAHEAD include REQ_FAILFAST_MASK?
next prev parent reply other threads:[~2010-06-18 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 7:47 [PATCH 2/2] block: unify flags for struct bio and struct request Christoph Hellwig
2010-06-18 9:07 ` Nick Piggin [this message]
2010-06-18 9:14 ` Christoph Hellwig
2010-06-18 9:33 ` Jens Axboe
2010-06-18 10:29 ` Jens Axboe
2010-06-18 16:57 ` Christoph Hellwig
2010-06-18 17:35 ` Jens Axboe
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=20100618090753.GF6138@laptop \
--to=npiggin@suse.de \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).