Re: [PATCH v3 04/11] blk-mq: Introduce blk_mq_quiesce_queue()
From: Bart Van Assche <hidden>
Date: 2016-10-19 16:13:43
Also in:
linux-nvme, linux-rdma, linux-scsi
On 10/19/2016 06:23 AM, Christoph Hellwig wrote:
quoted
+/** + * blk_mq_quiesce_queue() - wait until all ongoing queue_rq calls have finished + * + * Note: this function does not prevent that the struct request end_io() + * callback function is invoked. Additionally, it is not prevented that + * new queue_rq() calls occur unless the queue has been stopped first. + */ +void blk_mq_quiesce_queue(struct request_queue *q)If this is intended to be a kerneldoc comment you need to document the 'q' parameter. If not you should drop the magic "/**" marker.
Good catch. I will document the 'q' parameter.
quoted
+static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) +{ + int srcu_idx; + + WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && + cpu_online(hctx->next_cpu)); + + if (!(hctx->flags & BLK_MQ_F_BLOCKING)) { + rcu_read_lock(); + blk_mq_process_rq_list(hctx); + rcu_read_unlock(); + } else { + srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu); + blk_mq_process_rq_list(hctx); + srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx); + } +}Can you document these synchronization changes in detail in the changelog?
Sure, I will do that.
quoted
+static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, + struct request *rq, blk_qc_t *cookie) +{ + if (blk_mq_hctx_stopped(hctx) || + blk_mq_direct_issue_request(rq, cookie) != 0) + blk_mq_insert_request(rq, false, true, true); +}Any reason not to merge this function with blk_mq_direct_issue_request?
That sounds like a good idea to me. I will make the proposed change. Bart.