Skip to contentSkip to conversation

set request fastfail bit

PATCH In review Mike Christie 2 participants 3 messages Mar 10, 2004 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 set request fastfail bit

The first three bio and request flags are no longer identical. The bio barrier and rw flags are getting set in __make_request and get_request respectively, and failfast is getting left out. The attached patch (built against 2.6.4-rc3) sets the request's failfast flag in __make_request when the bio's flag is set.

Mike Chrisite

drivers/block/ll_rw_blk.c +6 -9
@@ -2121,11 +2121,14 @@ get_rq:
 		goto again;
 	}
 
+	req->flags |= REQ_CMD;
+
 	/*
-	 * first three bits are identical in rq->flags and bio->bi_rw,
-	 * see bio.h and blkdev.h
+	 * inherit FAILFAST from bio and don't stack up
+	 * retries for read ahead
 	 */
-	req->flags = (bio->bi_rw & 7) | REQ_CMD;
+	if (ra || test_bit(BIO_RW_FAILFAST, &bio->bi_rw))	
+		req->flags |= REQ_FAILFAST;
 
 	/*
 	 * REQ_BARRIER implies no merging, but lets make it explicit
@@ -2133,12 +2136,6 @@ get_rq:
 	if (barrier)
 		req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE);
 
-	/*
-	 * don't stack up retries for read ahead
-	 */
-	if (ra)
-		req->flags |= REQ_FAILFAST;
-
 	req->errors = 0;
 	req->hard_sector = req->sector = sector;
 	req->hard_nr_sectors = req->nr_sectors = nr_sectors;
#1 lore raw
Quoted 2 lines · Mike Christie

The first three bio and request flags are no longer identical. The bio barrier and rw flags are getting set in __make_request

      ^^^

That should have said request not bio.

Quoted 4 lines

and get_request respectively, and failfast is getting left out. The attached patch (built against 2.6.4-rc3) sets the request's failfast flag in __make_request when the bio's flag is set.

#2 lore raw
In reply to Mike Christie
Quoted 32 lines · Mike Christie

The first three bio and request flags are no longer identical. The bio barrier and rw flags are getting set in __make_request and get_request respectively, and failfast is getting left out. The attached patch (built against 2.6.4-rc3) sets the request's failfast flag in __make_request when the bio's flag is set.

Mike Chrisite

drivers/block/ll_rw_blk.c +6 -3
@@ -2121,11 +2121,14 @@ get_rq:
 		goto again;
 	}
 
+	req->flags |= REQ_CMD;
+
 	/*
-	 * first three bits are identical in rq->flags and bio->bi_rw,
-	 * see bio.h and blkdev.h
+	 * inherit FAILFAST from bio and don't stack up
+	 * retries for read ahead
 	 */
-	req->flags = (bio->bi_rw & 7) | REQ_CMD;
+	if (ra || test_bit(BIO_RW_FAILFAST, &bio->bi_rw))	
+		req->flags |= REQ_FAILFAST;
 
 	/*
 	 * REQ_BARRIER implies no merging, but lets make it explicit
@@ -2133,12 +2136,6 @@ get_rq:
 	if (barrier)
 		req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE);

drivers/block/ll_rw_blk.c get_rq: · line 2141

Quoted 10 lines
drivers/block/ll_rw_blk.c +0 -6
 
-	/*
-	 * don't stack up retries for read ahead
-	 */
-	if (ra)
-		req->flags |= REQ_FAILFAST;
-
 	req->errors = 0;
 	req->hard_sector = req->sector = sector;
 	req->hard_nr_sectors = req->nr_sectors = nr_sectors;

Thanks Mike, patch looks good.

Signature · 1 line
Jens Axboe