diff options
-rw-r--r-- | block/blk-core.c | 4 | ||||
-rw-r--r-- | block/blk-merge.c | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 5484838f46e7..b9a252cae4df 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1134,6 +1134,8 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
1134 | req->biotail = bio; | 1134 | req->biotail = bio; |
1135 | req->nr_sectors = req->hard_nr_sectors += nr_sectors; | 1135 | req->nr_sectors = req->hard_nr_sectors += nr_sectors; |
1136 | req->ioprio = ioprio_best(req->ioprio, prio); | 1136 | req->ioprio = ioprio_best(req->ioprio, prio); |
1137 | if (!blk_rq_cpu_valid(req)) | ||
1138 | req->cpu = bio->bi_comp_cpu; | ||
1137 | drive_stat_acct(req, 0); | 1139 | drive_stat_acct(req, 0); |
1138 | if (!attempt_back_merge(q, req)) | 1140 | if (!attempt_back_merge(q, req)) |
1139 | elv_merged_request(q, req, el_ret); | 1141 | elv_merged_request(q, req, el_ret); |
@@ -1161,6 +1163,8 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
1161 | req->sector = req->hard_sector = bio->bi_sector; | 1163 | req->sector = req->hard_sector = bio->bi_sector; |
1162 | req->nr_sectors = req->hard_nr_sectors += nr_sectors; | 1164 | req->nr_sectors = req->hard_nr_sectors += nr_sectors; |
1163 | req->ioprio = ioprio_best(req->ioprio, prio); | 1165 | req->ioprio = ioprio_best(req->ioprio, prio); |
1166 | if (!blk_rq_cpu_valid(req)) | ||
1167 | req->cpu = bio->bi_comp_cpu; | ||
1164 | drive_stat_acct(req, 0); | 1168 | drive_stat_acct(req, 0); |
1165 | if (!attempt_front_merge(q, req)) | 1169 | if (!attempt_front_merge(q, req)) |
1166 | elv_merged_request(q, req, el_ret); | 1170 | elv_merged_request(q, req, el_ret); |
diff --git a/block/blk-merge.c b/block/blk-merge.c index c77196d55899..908d3e11ac52 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -400,6 +400,8 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
400 | } | 400 | } |
401 | 401 | ||
402 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); | 402 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); |
403 | if (blk_rq_cpu_valid(next)) | ||
404 | req->cpu = next->cpu; | ||
403 | 405 | ||
404 | __blk_put_request(q, next); | 406 | __blk_put_request(q, next); |
405 | return 1; | 407 | return 1; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 93204bf7b297..12df8efeef19 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -545,6 +545,7 @@ enum { | |||
545 | #define blk_pm_request(rq) \ | 545 | #define blk_pm_request(rq) \ |
546 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) | 546 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
547 | 547 | ||
548 | #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) | ||
548 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | 549 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
549 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 550 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
550 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 551 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |