From patchwork Tue Feb 7 17:24:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 9560743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6639B6047A for ; Tue, 7 Feb 2017 17:26:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5981528426 for ; Tue, 7 Feb 2017 17:26:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E8AF2842C; Tue, 7 Feb 2017 17:26:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E454D28426 for ; Tue, 7 Feb 2017 17:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754211AbdBGR0E (ORCPT ); Tue, 7 Feb 2017 12:26:04 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36622 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755309AbdBGRZD (ORCPT ); Tue, 7 Feb 2017 12:25:03 -0500 Received: by mail-wm0-f50.google.com with SMTP id c85so170324033wmi.1 for ; Tue, 07 Feb 2017 09:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kXDcoASj+EL1Ui0V/YuPWGf8GfN3UsP7GYp/JUxGljs=; b=UrxbLafYdxjNO3mQ1Pj6HUbZV47EDCDBLuO9n+HoMdWtXKib+nuyBW5LAXrhGM1Ain KUgippMJJ/o0swGjEg6hjIroKvv7WBsSqr9ZYjGkDxVUKKlsHdJiTTqBg+c0qwxv+iv7 vWTyFkVrjD6WXp3Z3aGTUYSc0s9vqujs+QDTI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kXDcoASj+EL1Ui0V/YuPWGf8GfN3UsP7GYp/JUxGljs=; b=oysm/Lq7sWOZDLu5hoSwyC0mT2HfXgBwdCJPmYqTdYVjbHxqNC34hJYDJBwdfO6xjj VMW0XNZe+7sODB330ihR9OjUIl7mFrtNhhdx1bUo64SAfDP3DmzVlVlux3bJp+/m1hR2 L8uLdz4gXuB5AIpdcfP9Fmb+mA3+78NeKayjnaz7a6okgNHQzsiB4v4K5tna7wmi1I30 Q/IXG+lgtvOpIN5Y5AaG2zJeQjQmvYhTmSsEn8ZPGw0GYlpVo7CA7LFiW1RhYsMyxUkj ujAfSKVI6VV7VM/8DvLcCajdGLRV2Il2y3hy3Mop6jXeTeX248jBt6a01XSpAHCaMT/3 O80g== X-Gm-Message-State: AMke39k+lEeQZDDyeyVFjZwRFwXPOfW13BnTeFsQ0boHWLt77sEN4o58Xg24r+42654HXctM X-Received: by 10.28.188.213 with SMTP id m204mr13579087wmf.0.1486488301730; Tue, 07 Feb 2017 09:25:01 -0800 (PST) Received: from localhost.localdomain ([185.14.11.102]) by smtp.gmail.com with ESMTPSA id p7sm8384228wrc.34.2017.02.07.09.24.59 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Feb 2017 09:25:00 -0800 (PST) From: Paolo Valente To: Jens Axboe , Tejun Heo Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, Paolo Valente Subject: [WIP PATCHSET 1/4] blk-mq: pass bio to blk_mq_sched_get_rq_priv Date: Tue, 7 Feb 2017 18:24:43 +0100 Message-Id: <20170207172446.4528-2-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170207172446.4528-1-paolo.valente@linaro.org> References: <20170207172446.4528-1-paolo.valente@linaro.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP bio is used in bfq-mq's get_rq_priv, to get the request group. We could pass directly the group here, but I thought that passing the bio was more general, giving the possibility to get other pieces of information if needed. Signed-off-by: Paolo Valente --- block/blk-mq-sched.c | 8 +++++--- block/blk-mq-sched.h | 5 +++-- include/linux/elevator.h | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index ee455e7..314a8ed 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -68,7 +68,9 @@ int blk_mq_sched_init_hctx_data(struct request_queue *q, size_t size, EXPORT_SYMBOL_GPL(blk_mq_sched_init_hctx_data); static void __blk_mq_sched_assign_ioc(struct request_queue *q, - struct request *rq, struct io_context *ioc) + struct request *rq, + struct bio *bio, + struct io_context *ioc) { struct io_cq *icq; @@ -83,7 +85,7 @@ static void __blk_mq_sched_assign_ioc(struct request_queue *q, } rq->elv.icq = icq; - if (!blk_mq_sched_get_rq_priv(q, rq)) { + if (!blk_mq_sched_get_rq_priv(q, rq, bio)) { rq->rq_flags |= RQF_ELVPRIV; get_io_context(icq->ioc); return; @@ -99,7 +101,7 @@ static void blk_mq_sched_assign_ioc(struct request_queue *q, ioc = rq_ioc(bio); if (ioc) - __blk_mq_sched_assign_ioc(q, rq, ioc); + __blk_mq_sched_assign_ioc(q, rq, bio, ioc); } struct request *blk_mq_sched_get_request(struct request_queue *q, diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index 5954859..7b5f3b9 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -49,12 +49,13 @@ blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio) } static inline int blk_mq_sched_get_rq_priv(struct request_queue *q, - struct request *rq) + struct request *rq, + struct bio *bio) { struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.get_rq_priv) - return e->type->ops.mq.get_rq_priv(q, rq); + return e->type->ops.mq.get_rq_priv(q, rq, bio); return 0; } diff --git a/include/linux/elevator.h b/include/linux/elevator.h index b5825c4..ce14ede 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -99,7 +99,7 @@ struct elevator_mq_ops { void (*requeue_request)(struct request *); struct request *(*former_request)(struct request_queue *, struct request *); struct request *(*next_request)(struct request_queue *, struct request *); - int (*get_rq_priv)(struct request_queue *, struct request *); + int (*get_rq_priv)(struct request_queue *, struct request *, struct bio *); void (*put_rq_priv)(struct request_queue *, struct request *); void (*init_icq)(struct io_cq *); void (*exit_icq)(struct io_cq *);