Re: [RFC][PATCH v2 08/10] smp,irq_work: Use the new irq_work API

From: Christoph Hellwig
Date: Thu Aug 20 2020 - 02:19:36 EST


On Tue, Aug 18, 2020 at 12:51:10PM +0200, Peter Zijlstra wrote:
> if (blk_mq_complete_need_ipi(rq)) {
> - INIT_CSD(&rq->csd, __blk_mq_complete_request_remote, rq);
> - smp_call_function_single_async(rq->mq_ctx->cpu, &rq->csd);
> + rq->work = IRQ_WORK_INIT_HARD(__blk_mq_complete_request_remote);
> + irq_work_queue_remote_static(rq->mq_ctx->cpu, &rq->work);

So given the caller synchronization / use once semantics does it even
make sense to split the init vs call part here? What about:

irq_work_queue_remote_static(&rq->work, rq->mq_ctx->cpu,
__blk_mq_complete_request_remote);

instead? And btw, I'm not sure what the "static" stand for. Maybe
irq_work_queue_remote_once?