public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* rq_flag_bits and bio bi_rw flags
@ 2006-08-17 22:27 Matt Domsch
  2006-08-18  6:30 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Domsch @ 2006-08-17 22:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel

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?

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rq_flag_bits and bio bi_rw flags
  2006-08-17 22:27 rq_flag_bits and bio bi_rw flags Matt Domsch
@ 2006-08-18  6:30 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-08-18  6:30 UTC (permalink / raw)
  To: Matt Domsch; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-18  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-17 22:27 rq_flag_bits and bio bi_rw flags Matt Domsch
2006-08-18  6:30 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox