diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-08-23 08:50:29 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-08-23 08:50:29 -0400 |
commit | 65299a3b788bd274bed92f9fa3232082c9f3ea70 (patch) | |
tree | 191c0afe31c15ac4c1bab96e0a07fddb097d0de8 /fs | |
parent | 5dc06c5a70b79a323152bec7e55783e705767e63 (diff) |
block: separate priority boosting from REQ_META
Add a new REQ_PRIO to let requests preempt others in the cfq I/O schedule,
and lave REQ_META purely for marking requests as metadata in blktrace.
All existing callers of REQ_META except for XFS are updated to also
set REQ_PRIO for now.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/inode.c | 4 | ||||
-rw-r--r-- | fs/ext3/namei.c | 3 | ||||
-rw-r--r-- | fs/ext4/inode.c | 4 | ||||
-rw-r--r-- | fs/ext4/namei.c | 3 | ||||
-rw-r--r-- | fs/gfs2/log.c | 4 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 6 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 2 |
8 files changed, 15 insertions, 13 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index bba7b96e0d9b..12661e1deedd 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1134,7 +1134,7 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode, | |||
1134 | return bh; | 1134 | return bh; |
1135 | if (buffer_uptodate(bh)) | 1135 | if (buffer_uptodate(bh)) |
1136 | return bh; | 1136 | return bh; |
1137 | ll_rw_block(READ | REQ_META, 1, &bh); | 1137 | ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); |
1138 | wait_on_buffer(bh); | 1138 | wait_on_buffer(bh); |
1139 | if (buffer_uptodate(bh)) | 1139 | if (buffer_uptodate(bh)) |
1140 | return bh; | 1140 | return bh; |
@@ -2807,7 +2807,7 @@ make_io: | |||
2807 | trace_ext3_load_inode(inode); | 2807 | trace_ext3_load_inode(inode); |
2808 | get_bh(bh); | 2808 | get_bh(bh); |
2809 | bh->b_end_io = end_buffer_read_sync; | 2809 | bh->b_end_io = end_buffer_read_sync; |
2810 | submit_bh(READ | REQ_META, bh); | 2810 | submit_bh(READ | REQ_META | REQ_PRIO, bh); |
2811 | wait_on_buffer(bh); | 2811 | wait_on_buffer(bh); |
2812 | if (!buffer_uptodate(bh)) { | 2812 | if (!buffer_uptodate(bh)) { |
2813 | ext3_error(inode->i_sb, "ext3_get_inode_loc", | 2813 | ext3_error(inode->i_sb, "ext3_get_inode_loc", |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index c7d4032aa82a..0629e09f6511 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -922,7 +922,8 @@ restart: | |||
922 | bh = ext3_getblk(NULL, dir, b++, 0, &err); | 922 | bh = ext3_getblk(NULL, dir, b++, 0, &err); |
923 | bh_use[ra_max] = bh; | 923 | bh_use[ra_max] = bh; |
924 | if (bh) | 924 | if (bh) |
925 | ll_rw_block(READ | REQ_META, 1, &bh); | 925 | ll_rw_block(READ | REQ_META | REQ_PRIO, |
926 | 1, &bh); | ||
926 | } | 927 | } |
927 | } | 928 | } |
928 | if ((bh = bh_use[ra_ptr++]) == NULL) | 929 | if ((bh = bh_use[ra_ptr++]) == NULL) |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 1dfa18feeb3e..c7cbb3d85d9e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -650,7 +650,7 @@ struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode, | |||
650 | return bh; | 650 | return bh; |
651 | if (buffer_uptodate(bh)) | 651 | if (buffer_uptodate(bh)) |
652 | return bh; | 652 | return bh; |
653 | ll_rw_block(READ | REQ_META, 1, &bh); | 653 | ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); |
654 | wait_on_buffer(bh); | 654 | wait_on_buffer(bh); |
655 | if (buffer_uptodate(bh)) | 655 | if (buffer_uptodate(bh)) |
656 | return bh; | 656 | return bh; |
@@ -3301,7 +3301,7 @@ make_io: | |||
3301 | trace_ext4_load_inode(inode); | 3301 | trace_ext4_load_inode(inode); |
3302 | get_bh(bh); | 3302 | get_bh(bh); |
3303 | bh->b_end_io = end_buffer_read_sync; | 3303 | bh->b_end_io = end_buffer_read_sync; |
3304 | submit_bh(READ | REQ_META, bh); | 3304 | submit_bh(READ | REQ_META | REQ_PRIO, bh); |
3305 | wait_on_buffer(bh); | 3305 | wait_on_buffer(bh); |
3306 | if (!buffer_uptodate(bh)) { | 3306 | if (!buffer_uptodate(bh)) { |
3307 | EXT4_ERROR_INODE_BLOCK(inode, block, | 3307 | EXT4_ERROR_INODE_BLOCK(inode, block, |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index d36315ae629e..1c924faeb6c8 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -922,7 +922,8 @@ restart: | |||
922 | bh = ext4_getblk(NULL, dir, b++, 0, &err); | 922 | bh = ext4_getblk(NULL, dir, b++, 0, &err); |
923 | bh_use[ra_max] = bh; | 923 | bh_use[ra_max] = bh; |
924 | if (bh) | 924 | if (bh) |
925 | ll_rw_block(READ | REQ_META, 1, &bh); | 925 | ll_rw_block(READ | REQ_META | REQ_PRIO, |
926 | 1, &bh); | ||
926 | } | 927 | } |
927 | } | 928 | } |
928 | if ((bh = bh_use[ra_ptr++]) == NULL) | 929 | if ((bh = bh_use[ra_ptr++]) == NULL) |
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 85c62923ee29..598646434362 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -624,9 +624,9 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull) | |||
624 | bh->b_end_io = end_buffer_write_sync; | 624 | bh->b_end_io = end_buffer_write_sync; |
625 | get_bh(bh); | 625 | get_bh(bh); |
626 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) | 626 | if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) |
627 | submit_bh(WRITE_SYNC | REQ_META, bh); | 627 | submit_bh(WRITE_SYNC | REQ_META | REQ_PRIO, bh); |
628 | else | 628 | else |
629 | submit_bh(WRITE_FLUSH_FUA | REQ_META, bh); | 629 | submit_bh(WRITE_FLUSH_FUA | REQ_META | REQ_PRIO, bh); |
630 | wait_on_buffer(bh); | 630 | wait_on_buffer(bh); |
631 | 631 | ||
632 | if (!buffer_uptodate(bh)) | 632 | if (!buffer_uptodate(bh)) |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 747238cd9f96..be29858900f6 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -37,7 +37,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb | |||
37 | { | 37 | { |
38 | struct buffer_head *bh, *head; | 38 | struct buffer_head *bh, *head; |
39 | int nr_underway = 0; | 39 | int nr_underway = 0; |
40 | int write_op = REQ_META | | 40 | int write_op = REQ_META | REQ_PRIO | |
41 | (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); | 41 | (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); |
42 | 42 | ||
43 | BUG_ON(!PageLocked(page)); | 43 | BUG_ON(!PageLocked(page)); |
@@ -225,7 +225,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, | |||
225 | } | 225 | } |
226 | bh->b_end_io = end_buffer_read_sync; | 226 | bh->b_end_io = end_buffer_read_sync; |
227 | get_bh(bh); | 227 | get_bh(bh); |
228 | submit_bh(READ_SYNC | REQ_META, bh); | 228 | submit_bh(READ_SYNC | REQ_META | REQ_PRIO, bh); |
229 | if (!(flags & DIO_WAIT)) | 229 | if (!(flags & DIO_WAIT)) |
230 | return 0; | 230 | return 0; |
231 | 231 | ||
@@ -435,7 +435,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen) | |||
435 | if (buffer_uptodate(first_bh)) | 435 | if (buffer_uptodate(first_bh)) |
436 | goto out; | 436 | goto out; |
437 | if (!buffer_locked(first_bh)) | 437 | if (!buffer_locked(first_bh)) |
438 | ll_rw_block(READ_SYNC | REQ_META, 1, &first_bh); | 438 | ll_rw_block(READ_SYNC | REQ_META | REQ_PRIO, 1, &first_bh); |
439 | 439 | ||
440 | dblock++; | 440 | dblock++; |
441 | extlen--; | 441 | extlen--; |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 3bc073a4cf82..079587e53849 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -224,7 +224,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) | |||
224 | 224 | ||
225 | bio->bi_end_io = end_bio_io_page; | 225 | bio->bi_end_io = end_bio_io_page; |
226 | bio->bi_private = page; | 226 | bio->bi_private = page; |
227 | submit_bio(READ_SYNC | REQ_META, bio); | 227 | submit_bio(READ_SYNC | REQ_META | REQ_PRIO, bio); |
228 | wait_on_page_locked(page); | 228 | wait_on_page_locked(page); |
229 | bio_put(bio); | 229 | bio_put(bio); |
230 | if (!PageUptodate(page)) { | 230 | if (!PageUptodate(page)) { |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 053434049dbb..0e8bb13381e4 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -709,7 +709,7 @@ get_a_page: | |||
709 | set_buffer_uptodate(bh); | 709 | set_buffer_uptodate(bh); |
710 | 710 | ||
711 | if (!buffer_uptodate(bh)) { | 711 | if (!buffer_uptodate(bh)) { |
712 | ll_rw_block(READ | REQ_META, 1, &bh); | 712 | ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); |
713 | wait_on_buffer(bh); | 713 | wait_on_buffer(bh); |
714 | if (!buffer_uptodate(bh)) | 714 | if (!buffer_uptodate(bh)) |
715 | goto unlock_out; | 715 | goto unlock_out; |