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: 93572 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2301636qgi; Tue, 7 Feb 2017 09:25:19 -0800 (PST) X-Received: by 10.84.135.162 with SMTP id 31mr27579107plj.35.1486488319487; Tue, 07 Feb 2017 09:25:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t62si4659322pfg.41.2017.02.07.09.25.19; Tue, 07 Feb 2017 09:25:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755464AbdBGRZH (ORCPT + 25 others); Tue, 7 Feb 2017 12:25:07 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38518 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755355AbdBGRZE (ORCPT ); Tue, 7 Feb 2017 12:25:04 -0500 Received: by mail-wm0-f51.google.com with SMTP id r141so160922276wmg.1 for ; Tue, 07 Feb 2017 09:25:03 -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=WENY02WpWFfApAmsRHd0ZQyBmnMbSlNfrolmPk6a13FfnqqWV7ezsBk7aLRSFGqZ2d X0D7EAqFrVRz3qKVtALFJqYt5FPuCPbyUUbkaR/Cx89MWTqutgoiwjicCDbND9gYlwAt E5WJAc+PamVyqt1BipnoFMxnjkbYdVuZ9TvvhZnvI+hk1hOM/X46CzR2vRGNZ4lx74N4 8ppjUljwB6bxRSAIxwv3KuLL2kS4WAEX/ZmXt+bHp6m0/GLjHkuRJbyPIjniw9oLUQNG xlhhiwkNhZ6CzS6so8mAps1u/OFmzBIbq5HQbWE6wuedC7oXZBnU1FYtrvP9es2y908a Zurw== X-Gm-Message-State: AMke39lQWx67sRGudE30vufff6HhiOg+EcY4rg+VxxIxbMG6okWi/pBA4CWPIiZez7TF9z/f 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.10.0 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 *);