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: CloudedQuartz <ravenklawasd@gmail.com>
Signed-off-by: Mayur <ultramayur123@gmail.com>
This commit is contained in:
Tyler Nijmeh
2019-06-14 16:01:55 -07:00
committed by debdeep199x
parent d57ce20bfd
commit 008e2ff540

View File

@@ -109,8 +109,13 @@ void __blk_complete_request(struct request *req)
/*
* Select completion CPU
*
* 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.
*/
if (req->cpu != -1) {
if (req->cpu != -1 && !idle_cpu(req->cpu)) {
ccpu = req->cpu;
if (!test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags))
shared = cpus_share_cache(cpu, ccpu);