Re: [PATCH v2 1/5] blk-mq-sched: introduce high level elevator lock

From: Yu Kuai
Date: Wed Jul 30 2025 - 14:00:36 EST


Hi

在 2025/7/31 1:19, Bart Van Assche 写道:
On 7/30/25 1:22 AM, Yu Kuai wrote:
+        if (sq_sched)
+            spin_lock(&e->lock);
          rq = e->type->ops.dispatch_request(hctx);
+        if (sq_sched)
+            spin_unlock(&e->lock);

The above will confuse static analyzers. Please change it into something
like the following:

if (blk_queue_sq_sched(q)) {
    spin_lock(&e->lock);
    rq = e->type->ops.dispatch_request(hctx);
    spin_unlock(&e->lock);
} else {
    rq = e->type->ops.dispatch_request(hctx);
}

Otherwise this patch looks good to me.
Ok, thanks for the review, will change in the next version.
Kuai


Thanks,

Bart.