Skip to content

Commit d5bcf71

Browse files
tytydracoDhineshCool
authored andcommitted
block: Do not wake the request CPU if idle
Refrain from waking up an idle CPU if possible since the exit latency of taking req->cpu out of an idle cstate will likely exceed the rq->deadline constraint compared to executing the request locally instead. Signed-off-by: Tyler Nijmeh <tylernij@gmail.com> Signed-off-by: Twisted Prime <36546624+TwistedPrime@users.noreply.github.com>
1 parent 1134097 commit d5bcf71

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

block/blk-softirq.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ void __blk_complete_request(struct request *req)
107107

108108
/*
109109
* Select completion CPU
110+
*
111+
* Refrain from waking up an idle CPU if possible since the exit
112+
* latency of taking req->cpu out of an idle cstate will likely
113+
* exceed the rq->deadline constraint compared to executing the
114+
* request locally instead.
110115
*/
111-
if (req->cpu != -1) {
116+
if (req->cpu != -1 && !idle_cpu(req->cpu)) {
112117
ccpu = req->cpu;
113118
if (!test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags))
114119
shared = cpus_share_cache(cpu, ccpu);

0 commit comments

Comments
 (0)