From patchwork Tue Nov 23 16:18:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 12634549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8454CC433F5 for ; Tue, 23 Nov 2021 16:18:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237261AbhKWQVY (ORCPT ); Tue, 23 Nov 2021 11:21:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbhKWQVY (ORCPT ); Tue, 23 Nov 2021 11:21:24 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ABE3C061574 for ; Tue, 23 Nov 2021 08:18:16 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id m5so13836833ilh.11 for ; Tue, 23 Nov 2021 08:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3vVFO+/R5NkLbL7rYZ4JlMVhNlcOZaatMH92z117Iuw=; b=S0iV+LeR0mLu8k8I2zrXEGnUWCxdyBRzz0dDzrlvGyGHSUuWV/6RGAiZrhT+xDLc92 csYcGWbcYOdKfJ6b3gmKiUgxGUbmijA+xRscFHPGBPZe9D3ukhDkhEf+JbzbicA4OrXO 1skB2WxoPVa/tJPAq49dz3XTBnd9WAIHEWZzLARMzleauZXEuCJkkGNbzMnqotQSsYAY DdypoJeN10NDmzS9rh7WhWlbkwpIeRuKB/96V8Snc+FGiu4OgR8VNoyRNc8wO6Z9PIOt r8LMccR50OM9EPtNrQL9WcYdajb409LjD5tWJodBc4YtfWghvWQwyP8J633PeQsmaDxE Vq1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3vVFO+/R5NkLbL7rYZ4JlMVhNlcOZaatMH92z117Iuw=; b=MEmGtQzQx3wCRcXhIw2vbQ7Ra1BZKDNKzzYNjPKkbsDoxp/eUofnqtE3GNnOp6HTfQ omLlxKcgfHBYasmkUXvvnwxm7AJT8oNu/WPk0CqlIexZ7YozMeLq8gTHFghBO5BZFjIz Gc7SnS5/kIbcwyeqD07SAVYvk+ugvhDkR7s6AlDxz7Zu2hVI6JHXMFeaBJLHWrOMDUDt N0rR8gY3hxiwOhT7B4VKkZCTshPveC0OOvt0257L/9V/4N8oPgd9Y6O6VVsd9nI1If5/ 7TlzyQvbT29EW4rYGULP5BcGftKLgu3TEXGJXhgGceKOeoEOqnvyMDWEZRRrmk5TsmEa CTMQ== X-Gm-Message-State: AOAM5321uIFaBnqmqc17y1reE1hibEQYbcLF6TufZB2lT24EAsl9RtDI 0XsMICdjUrIJ55mYPGp8D+yhI0fw0d9km3Rq X-Google-Smtp-Source: ABdhPJxKK+zsrcw44Z7sLdyWRQW024Kp1xseFIllqLTjgJGkzaS4YbF41EvPuOsfhjnwE04VQzw6jg== X-Received: by 2002:a92:c241:: with SMTP id k1mr6699994ilo.207.1637684295476; Tue, 23 Nov 2021 08:18:15 -0800 (PST) Received: from p1.localdomain ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id t188sm7858034iof.5.2021.11.23.08.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 08:18:15 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 1/3] block: move io_context creation into where it's needed Date: Tue, 23 Nov 2021 09:18:11 -0700 Message-Id: <20211123161813.326307-2-axboe@kernel.dk> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211123161813.326307-1-axboe@kernel.dk> References: <20211123161813.326307-1-axboe@kernel.dk> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The only user of the io_context for IO is BFQ, yet we put the checking and logic of it into the normal IO path. Move the assignment and creation into BFQ. Signed-off-by: Jens Axboe --- block/bfq-iosched.c | 6 ++++++ block/blk-core.c | 9 --------- block/blk-ioc.c | 1 + block/blk-mq-sched.c | 1 + block/blk-mq.c | 3 --- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index fec18118dc30..a82475361a7e 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6573,6 +6573,12 @@ static struct bfq_queue *bfq_get_bfqq_handle_split(struct bfq_data *bfqd, */ static void bfq_prepare_request(struct request *rq) { + /* create task io_context, if we don't have one already */ + if (unlikely(!current->io_context)) + create_task_io_context(current, GFP_ATOMIC, rq->q->node); + + blk_mq_sched_assign_ioc(rq); + /* * Regardless of whether we have an icq attached, we have to * clear the scheduler pointers, as they might point to diff --git a/block/blk-core.c b/block/blk-core.c index 6443f2dfe43e..6ae8297b033f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -750,15 +750,6 @@ noinline_for_stack bool submit_bio_checks(struct bio *bio) break; } - /* - * Various block parts want %current->io_context, so allocate it up - * front rather than dealing with lots of pain to allocate it only - * where needed. This may fail and the block layer knows how to live - * with it. - */ - if (unlikely(!current->io_context)) - create_task_io_context(current, GFP_ATOMIC, q->node); - if (blk_throtl_bio(bio)) return false; diff --git a/block/blk-ioc.c b/block/blk-ioc.c index 57299f860d41..736e0280d76f 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -286,6 +286,7 @@ int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node) return ret; } +EXPORT_SYMBOL_GPL(create_task_io_context); /** * get_task_io_context - get io_context of a task diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index ba21449439cc..550e27189be2 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -43,6 +43,7 @@ void blk_mq_sched_assign_ioc(struct request *rq) get_io_context(icq->ioc); rq->elv.icq = icq; } +EXPORT_SYMBOL_GPL(blk_mq_sched_assign_ioc); /* * Mark a hardware queue as needing a restart. For shared queues, maintain diff --git a/block/blk-mq.c b/block/blk-mq.c index 4c00b22590cc..20a6445f6a01 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -406,9 +406,6 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, if (!op_is_flush(data->cmd_flags) && e->type->ops.prepare_request) { - if (e->type->icq_cache) - blk_mq_sched_assign_ioc(rq); - e->type->ops.prepare_request(rq); rq->rq_flags |= RQF_ELVPRIV; } From patchwork Tue Nov 23 16:18:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 12634551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45667C433EF for ; Tue, 23 Nov 2021 16:18:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237881AbhKWQVZ (ORCPT ); Tue, 23 Nov 2021 11:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbhKWQVZ (ORCPT ); Tue, 23 Nov 2021 11:21:25 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C5DC061574 for ; Tue, 23 Nov 2021 08:18:17 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id z26so28586794iod.10 for ; Tue, 23 Nov 2021 08:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=obLep7hKn/j/EoRL8hQqMnp3Wbyin21r4clAytoEnPo=; b=6OvPIEed+0q7rJ2Ent79HCOTOY6y5R9WWfMPopMWqQEEe5iaQyHzpV4qHCayIhR4uM Kf6NN1s3M0dxdoakVWJC+DcsSOamApCS493/x656k2+RzLHXK1l6VHiPEX2tC6STEHpv dBFpEcuvZzv2rLH3kA8oqDeHoTpbqAFPJ5prSbG53J24jml8cLBbRkBQEXwDUkmOEcDX qrQnOfanCQg6IM5KKjffO4xTu4TkLF2rSXZfqa/VIhJup/1tH1T56sdAeQ5Gl2MreCT9 U0Nz/bJcHph5T0OACMBKoENBcsQTsGOJ+wGK2Q+x1mD6b9SsEQXYhlRm91ODq31WIZsv kRPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=obLep7hKn/j/EoRL8hQqMnp3Wbyin21r4clAytoEnPo=; b=yDrwHQlsx0uTi7TtPRTCgboh/cimWNr6czhkAd4I/sHXzdEfYhsj6Gm1mQld/P8v5R +zWiV1PmmLjBf8mxxQPyc/zMJMEmGIzV6Rgf3lWde5WHwrFGs6aH/v6bQMGP++x6EJ3Z WcrpqNB+jI7tbfECRB55zbQQGcChomMnll3tDjCwflcFsOhKQ0DLGN+RGPgoMgKZ9EO+ jZypWNepDZom9BaPgmRoEBqtuj+NH1bVrIcP4aEQfox3BgXeeL/z+1UDAuntk/LgiisL wY/V6rd6Q5O4qIooUX+9MWN1WvSzXc9gYNbfvYrpW8yvfLFRuNQaHr4Sy5ZueOCxNLoE 8LTA== X-Gm-Message-State: AOAM533fUVXaC8H7KkfRyPNORl7npoZPM+MySmneDGGcURMHKVQozzhO 0z23a1sB+h9rWRMduezF6r4tKLor+QjU+3zS X-Google-Smtp-Source: ABdhPJwANfSIAVk6C9dAlazToDzoQMmF7XPTpjDVwmd4XvSKb8kgMpt1F2AVGIZMfR0fEhrPxofxug== X-Received: by 2002:a05:6602:8da:: with SMTP id h26mr7251449ioz.76.1637684296220; Tue, 23 Nov 2021 08:18:16 -0800 (PST) Received: from p1.localdomain ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id t188sm7858034iof.5.2021.11.23.08.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 08:18:15 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 2/3] blk-ioprio: don't set bio priority if not needed Date: Tue, 23 Nov 2021 09:18:12 -0700 Message-Id: <20211123161813.326307-3-axboe@kernel.dk> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211123161813.326307-1-axboe@kernel.dk> References: <20211123161813.326307-1-axboe@kernel.dk> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org We don't need to write to the bio if: 1) No ioprio value has ever been assigned to the blkcg 2) We wouldn't anyway, depending on bio and blkcg IO priority Signed-off-by: Jens Axboe --- block/blk-ioprio.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/block/blk-ioprio.c b/block/blk-ioprio.c index 332a07761bf8..2e7f10e1c03f 100644 --- a/block/blk-ioprio.c +++ b/block/blk-ioprio.c @@ -62,6 +62,7 @@ struct ioprio_blkg { struct ioprio_blkcg { struct blkcg_policy_data cpd; enum prio_policy prio_policy; + bool prio_set; }; static inline struct ioprio_blkg *pd_to_ioprio(struct blkg_policy_data *pd) @@ -112,7 +113,7 @@ static ssize_t ioprio_set_prio_policy(struct kernfs_open_file *of, char *buf, if (ret < 0) return ret; blkcg->prio_policy = ret; - + blkcg->prio_set = true; return nbytes; } @@ -190,6 +191,10 @@ static void blkcg_ioprio_track(struct rq_qos *rqos, struct request *rq, struct bio *bio) { struct ioprio_blkcg *blkcg = ioprio_blkcg_from_bio(bio); + u16 prio; + + if (!blkcg->prio_set) + return; /* * Except for IOPRIO_CLASS_NONE, higher I/O priority numbers @@ -199,8 +204,10 @@ static void blkcg_ioprio_track(struct rq_qos *rqos, struct request *rq, * bio I/O priority is not modified. If the bio I/O priority equals * IOPRIO_CLASS_NONE, the cgroup I/O priority is assigned to the bio. */ - bio->bi_ioprio = max_t(u16, bio->bi_ioprio, - IOPRIO_PRIO_VALUE(blkcg->prio_policy, 0)); + prio = max_t(u16, bio->bi_ioprio, + IOPRIO_PRIO_VALUE(blkcg->prio_policy, 0)); + if (prio > bio->bi_ioprio) + bio->bi_ioprio = prio; } static void blkcg_ioprio_exit(struct rq_qos *rqos) From patchwork Tue Nov 23 16:18:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 12634553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28BD1C433FE for ; Tue, 23 Nov 2021 16:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237907AbhKWQV0 (ORCPT ); Tue, 23 Nov 2021 11:21:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237830AbhKWQV0 (ORCPT ); Tue, 23 Nov 2021 11:21:26 -0500 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE3ECC061574 for ; Tue, 23 Nov 2021 08:18:17 -0800 (PST) Received: by mail-io1-xd2c.google.com with SMTP id z18so28637876iof.5 for ; Tue, 23 Nov 2021 08:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=moELeGt6WK+VFN+ZdytMO9/BkmVHzLZ2ioec9HfZZP0=; b=uxHYO8o50dX92uCdpvKFsU6xC9jabWNzLBo9PcTycK/kin1Yrwo1/nHTbxOEdgb8ms wbRks2epH7uDPMhAVkRMVvtZmSHxpTKu9k7vRAeU64r1/whuMeIrRfxX8PqwPeJ6sXTM bbFVdMCnFIV+dVqMIbhNZ4N4PldSTBc3WdjSTWXXEoVyHuadz/3kBZUWVk1jvqF7plpo xcCQhVmcgnogT2v4XKqnsmQ1cGp43F0kPRXVAnRdbjXQL6Jk/zKNEOBVnEklRVrnMQkz +odNFbp2F4xQjx36qxvJwMDJ+OUNokGt0VV+FxPrjqaxmcFW80hE/mvIUK3EnqIzMALt isCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=moELeGt6WK+VFN+ZdytMO9/BkmVHzLZ2ioec9HfZZP0=; b=mMAE60lR4bALhsAfuuBI79GkrLWZyew0ms3iUW7q0fqmSCk/3snzMQN5mWcXrGIeD/ kkEg8oBSHV2DX850293mSkXJG5SQmjvULtL/vkVd1bB2EAbCbUkUTlKheXA5wc5QFObk oo8KuIoDEItsumKa/yCYnaCtOltbA8/LgTSQD4cZ+7tHCwcdM/th99qIKTckojLu8GS4 FUzBVFifn6ji6gBabWVpNW1E3JIo1piJnI180GukH1xanFBc1c9/DMA/OXoB3WPlYUS4 Zu5V4mtipfAnYk8JShDhp86XXReL5YDHIRI+RvYDutoLlc40gu1D4sZTBGKaefWYIYKT gc+g== X-Gm-Message-State: AOAM532ipawW8c/9iQHnG8IMD2djG5IdMfXiplSugnd/lHOwurD1Vw/B jN1Bz/nzg21JqUy3HnZFzE4PARqMzb0B1PRb X-Google-Smtp-Source: ABdhPJwy4dDODwHFFjUNXF1VATa+Coi1DIpKDOYmkaHAHPvE0lZDI9AZd/0xLCW6klIeSaHmwFc3Yw== X-Received: by 2002:a05:6602:1484:: with SMTP id a4mr7333595iow.35.1637684297118; Tue, 23 Nov 2021 08:18:17 -0800 (PST) Received: from p1.localdomain ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id t188sm7858034iof.5.2021.11.23.08.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 08:18:16 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 3/3] block: only allocate poll_stats if there's a user of them Date: Tue, 23 Nov 2021 09:18:13 -0700 Message-Id: <20211123161813.326307-4-axboe@kernel.dk> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211123161813.326307-1-axboe@kernel.dk> References: <20211123161813.326307-1-axboe@kernel.dk> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This is essentially never used, yet it's about 1/3rd of the total queue size. Allocate it when needed, and don't embed it in the queue. Signed-off-by: Jens Axboe --- block/blk-mq.c | 20 ++++++++++++++++++-- block/blk-stat.c | 6 ------ block/blk-sysfs.c | 1 + include/linux/blkdev.h | 9 +++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 20a6445f6a01..cb41c441aa8f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4577,9 +4577,25 @@ EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues); /* Enable polling stats and return whether they were already enabled. */ static bool blk_poll_stats_enable(struct request_queue *q) { - if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags) || - blk_queue_flag_test_and_set(QUEUE_FLAG_POLL_STATS, q)) + struct blk_rq_stat *poll_stat; + + if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags)) return true; + + poll_stat = kzalloc(BLK_MQ_POLL_STATS_BKTS * sizeof(*poll_stat), + GFP_ATOMIC); + if (!poll_stat) + return false; + + spin_lock_irq(&q->stats->lock); + if (blk_queue_flag_test_and_set(QUEUE_FLAG_POLL_STATS, q)) { + spin_unlock_irq(&q->stats->lock); + kfree(poll_stat); + return true; + } + q->poll_stat = poll_stat; + spin_unlock_irq(&q->stats->lock); + blk_stat_add_callback(q, q->poll_cb); return false; } diff --git a/block/blk-stat.c b/block/blk-stat.c index ae3dd1fb8e61..7ba504166d1b 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -12,12 +12,6 @@ #include "blk-mq.h" #include "blk.h" -struct blk_queue_stats { - struct list_head callbacks; - spinlock_t lock; - bool enable_accounting; -}; - void blk_rq_stat_init(struct blk_rq_stat *stat) { stat->min = -1ULL; diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cd75b0f73dc6..e1b846ec58cb 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -790,6 +790,7 @@ static void blk_release_queue(struct kobject *kobj) blk_stat_free_callback(q->poll_cb); blk_free_queue_stats(q->stats); + kfree(q->poll_stat); blk_exit_queue(q); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index bd4370baccca..b46fd2a80062 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -28,10 +28,15 @@ struct blk_flush_queue; struct kiocb; struct pr_ops; struct rq_qos; -struct blk_queue_stats; struct blk_stat_callback; struct blk_crypto_profile; +struct blk_queue_stats { + struct list_head callbacks; + spinlock_t lock; + bool enable_accounting; +}; + /* Must be consistent with blk_mq_poll_stats_bkt() */ #define BLK_MQ_POLL_STATS_BKTS 16 @@ -267,7 +272,7 @@ struct request_queue { int poll_nsec; struct blk_stat_callback *poll_cb; - struct blk_rq_stat poll_stat[BLK_MQ_POLL_STATS_BKTS]; + struct blk_rq_stat *poll_stat; struct timer_list timeout; struct work_struct timeout_work;