All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Matt Domsch <Matt_Domsch@dell.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: rq_flag_bits and bio bi_rw flags
Date: Fri, 18 Aug 2006 08:30:13 +0200	[thread overview]
Message-ID: <20060818063012.GB798@suse.de> (raw)
In-Reply-To: <20060817222752.GA19442@lists.us.dell.com>

On Thu, Aug 17 2006, Matt Domsch wrote:
> Jens, I'm hoping you can clear something up for me.
> 
> ll_rw_blk.c:
> void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct
> bio *bio)
> {
>         /* first three bits are identical in rq->flags and bio->bi_rw
> 	*/
>         rq->flags |= (bio->bi_rw & 7);
> 
> That was recently changed to be the first 2 bits not 3.  But it made
> me look.
> 
> /*
>  * bio bi_rw flags
>  *
>  * bit 0 -- read (not set) or write (set)
>  * bit 1 -- rw-ahead when set
>  * bit 2 -- barrier
>  * bit 3 -- fail fast, don't want low level driver retries
>  * bit 4 -- synchronous I/O hint: the block layer will unplug immediately
>  */
> #define BIO_RW          0
> #define BIO_RW_AHEAD    1
> #define BIO_RW_BARRIER  2
> #define BIO_RW_FAILFAST 3
> #define BIO_RW_SYNC     4
> 
> 
> /*
>  * first three bits match BIO_RW* bits, important
>  */
> enum rq_flag_bits {
>         __REQ_RW,               /* not set, read. set, write */
>         __REQ_FAILFAST,         /* no low level driver retries */
>         __REQ_SORTED,           /* elevator knows about this request
> 	*/
> 
> 
> The first bit matches.  The second doesn't (BIO_RW_AHEAD vs
> __REQ_FAILFAST).  And obviously you just fixed the third bit.
> 
> Should BIO_RW_FAILFAST == __REQ_FAILFAST instead?

It does match, a rw-ahead request implies fail fast since we don't want
to be retrying read-head type IO. Could do with a better comment though,
but it's fully on purpose.

-- 
Jens Axboe


      reply	other threads:[~2006-08-18  6:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-17 22:27 rq_flag_bits and bio bi_rw flags Matt Domsch
2006-08-18  6:30 ` Jens Axboe [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=20060818063012.GB798@suse.de \
    --to=axboe@suse.de \
    --cc=Matt_Domsch@dell.com \
    --cc=linux-kernel@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.