From patchwork Fri Dec 4 15:20:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minwoo Im X-Patchwork-Id: 11951847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6318C433FE for ; Fri, 4 Dec 2020 15:22:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8583C22BF3 for ; Fri, 4 Dec 2020 15:22:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730455AbgLDPWA (ORCPT ); Fri, 4 Dec 2020 10:22:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730451AbgLDPWA (ORCPT ); Fri, 4 Dec 2020 10:22:00 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B3BC061A4F; Fri, 4 Dec 2020 07:21:20 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id p6so3264196plo.6; Fri, 04 Dec 2020 07:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=stxdKLjkawSzgni2iKOcapaYxt02iCojFmRSwnh2uv4=; b=Xu9r1WgGtDgJyFPqSCEaH1eaqpDrKVqg3UeHFPVrzwYIvxsCVSVsAFW2SQGE5y6Lep cS15BR3dGK4w5VOJgSde5oK9xubzlj4QeqL4MzOWzul2PXycueYhM4RGYqrbp9TeDpkf OAbsm6fu5NKzcBX0aCjK+DPzLryiNPiRZ1XF+eofmoW+jCdMc6PdCcP11k7i9fAddxGW 6iyfnjzXMr+0All5cClowI3UiWtjpHLFvWseOodks9F4+Rd7RP7l7d7Bv+g9ybZnWkhF O4Bka/DXrbft3B7xQ8nMVRrKRNgx6cgdUWe/TOHPKOHi6djfEI4YhlzJWmZU+28NZ8VR K3Hw== 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=stxdKLjkawSzgni2iKOcapaYxt02iCojFmRSwnh2uv4=; b=UP5kUMvOASoSvPyuTkO21a6oQwkb1LcY5B3T+25rD531L1UyT6KIFqZJNqIhiSBtLC K59j1dcwAECaiuidYXCqpW5wTnj7lrv5ElSoeMRicPWk2e9GZDnm9OwLoPNE+/lsqNXF aCZtL0LdWYpe4K8NR26WpnGIWRwBcjC67RialAOCn/l2cDRXgk7y6SfC4FrBfFpZy6ei 8hgg2lcU5ALpyhOpZP83bf6N55E/VzQduZl3U3pKpBYIbWVPtMtvn4gcbWUAyjXZBiXd kqAvsnfBKgDrWdrzHhkfqLYAQ2Yy1I8x4pQs/GBttVoXn/I0TezcA1rkQcDNmofZq7dR YDPw== X-Gm-Message-State: AOAM531opqyozUPYS5wGpw2csYLtmXaUtN6SmjIOK81Kjh9ouPyczgr6 iWoI5XcE0qSBHgHmtmznYhpHihzbXMf4qg== X-Google-Smtp-Source: ABdhPJyh0UJjst4bpJ88fcYURqLnMib2+KJI0IFQthlFH6h7KvBn2yCUeMH1KbRWU+MW3qXVEtN0+w== X-Received: by 2002:a17:90a:de95:: with SMTP id n21mr4538015pjv.62.1607095279801; Fri, 04 Dec 2020 07:21:19 -0800 (PST) Received: from localhost.localdomain ([211.108.35.36]) by smtp.gmail.com with ESMTPSA id d20sm2407286pjz.3.2020.12.04.07.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 07:21:19 -0800 (PST) From: Minwoo Im To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Minwoo Im Subject: [PATCH 1/3] blk-mq: add helper allocating tagset->tags Date: Sat, 5 Dec 2020 00:20:53 +0900 Message-Id: <20201204152055.31605-2-minwoo.im.dev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201204152055.31605-1-minwoo.im.dev@gmail.com> References: <20201204152055.31605-1-minwoo.im.dev@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org tagset->set is allocated from blk_mq_alloc_tag_set() rather than being reallocated. This patch added a helper to make its meaning explicitly which is to allocate rather than to reallocate. Signed-off-by: Minwoo Im --- block/blk-mq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 37c682855a63..69771ba18f1f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3377,6 +3377,12 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set, return 0; } +static int blk_mq_alloc_tag_set_tags(struct blk_mq_tag_set *set, + int new_nr_hw_queues) +{ + return blk_mq_realloc_tag_set_tags(set, 0, new_nr_hw_queues); +} + /* * Alloc a tag set to be associated with one or more request queues. * May fail with EINVAL for various error conditions. May adjust the @@ -3430,7 +3436,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) if (set->nr_maps == 1 && set->nr_hw_queues > nr_cpu_ids) set->nr_hw_queues = nr_cpu_ids; - if (blk_mq_realloc_tag_set_tags(set, 0, set->nr_hw_queues) < 0) + if (blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues) < 0) return -ENOMEM; ret = -ENOMEM; From patchwork Fri Dec 4 15:20:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minwoo Im X-Patchwork-Id: 11951851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC5CC4361A for ; Fri, 4 Dec 2020 15:22:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA38022B43 for ; Fri, 4 Dec 2020 15:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730495AbgLDPWE (ORCPT ); Fri, 4 Dec 2020 10:22:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730493AbgLDPWD (ORCPT ); Fri, 4 Dec 2020 10:22:03 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34A1C061A51; Fri, 4 Dec 2020 07:21:23 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id h7so3918159pjk.1; Fri, 04 Dec 2020 07:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8GRsx9W76nEBQns60PeqGvsE174WKc8EGtATwU1W+Mk=; b=ZRWSnWUpHR7bxPL4x8js8hAdm6O/rRmk44fJZouOiMlI2fDrcJ/RFeznLWPuvn2To8 Q5pHXgTK3vb8Y6fBCV1+2NA57tGJk0x+b8OJIwcpfRfTuKWtQIMW0u9L5iL92z2fx55g taF5/1LGsR8eDMd3ixu+UAFYskDhQxc7oOlhZ1y4wl8nuSKoA2b6wMsvYd7+vPyFDExS GXqsrZ+yXbuYyq79nxvYQCSorXbWCxs/M8DNPZaH8L97s162zClJ683mlwCCkdswrTXS 2hRAeoO49Ez9ogtp/+sWn7751KQs+J21U2HmSXm5t5EwEt135lCONEN3byraZFFeq8o2 iY1A== 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=8GRsx9W76nEBQns60PeqGvsE174WKc8EGtATwU1W+Mk=; b=C4Fros4YL01XlNcS1CBLweL8u8BrCmVC2LoOW9wg/gj3cF+P8vjKH8M2zYT+6VlACI +vEsP5GMS9VRjZbk4muVgITge56tpTVhst4LtZePlzEqcOgqOFhkJfIvTdaZIoc1VQa0 V+/cZP3trCq1qXqgJnCnRDsQXYxY/dTkYkcXp7jVN4d2WSHt4VGtoY7MTLfPdtpY4S2O qx6iEaMXLLx2CeQS+q6H28ysWTUnubPWzOMyLdIJSZY42SIm5rnLDF6iWsuP5yc5zPbT HHjkfxBd0IjHPRyAeP7xDLZ5Q+GYFtVgVRrlfm2B5G3gUQBTJo1JueFDQ6ACeGMQ7uWE t4TA== X-Gm-Message-State: AOAM531wU/Mebi3RoQCRUe06KC/MIBY2dKRdbxntkj/TK/Bavf5qyY+Y KPWLS2h8/M9Dc0oeUYdri2qW1uzLb0gZyw== X-Google-Smtp-Source: ABdhPJxAAjgMASqa7LiteK08rLw7jgKDZKMXTw0cxaAcqYs/DnA/YiChnZ8/8ghAvJig9mWJ3XqYuw== X-Received: by 2002:a17:90b:1645:: with SMTP id il5mr4658326pjb.15.1607095283170; Fri, 04 Dec 2020 07:21:23 -0800 (PST) Received: from localhost.localdomain ([211.108.35.36]) by smtp.gmail.com with ESMTPSA id d20sm2407286pjz.3.2020.12.04.07.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 07:21:22 -0800 (PST) From: Minwoo Im To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Minwoo Im Subject: [PATCH 2/3] blk-mq: update arg in comment of blk_mq_map_queue Date: Sat, 5 Dec 2020 00:20:54 +0900 Message-Id: <20201204152055.31605-3-minwoo.im.dev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201204152055.31605-1-minwoo.im.dev@gmail.com> References: <20201204152055.31605-1-minwoo.im.dev@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Update mis-named argument description of blk_mq_map_queue(). This patch also updates description that argument to software queue percpu context. Signed-off-by: Minwoo Im Reviewed-by: John Garry --- block/blk-mq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.h b/block/blk-mq.h index c696515766c7..c1458d9502f1 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -99,7 +99,7 @@ static inline struct blk_mq_hw_ctx *blk_mq_map_queue_type(struct request_queue * * blk_mq_map_queue() - map (cmd_flags,type) to hardware queue * @q: request queue * @flags: request command flags - * @cpu: cpu ctx + * @ctx: software queue cpu ctx */ static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q, unsigned int flags, From patchwork Fri Dec 4 15:20:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minwoo Im X-Patchwork-Id: 11951849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D16E7C2BB3F for ; Fri, 4 Dec 2020 15:22:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A270422C9C for ; Fri, 4 Dec 2020 15:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730518AbgLDPWH (ORCPT ); Fri, 4 Dec 2020 10:22:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730493AbgLDPWH (ORCPT ); Fri, 4 Dec 2020 10:22:07 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E920C061A53; Fri, 4 Dec 2020 07:21:27 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id n7so3708761pgg.2; Fri, 04 Dec 2020 07:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zSiFncf9bc1IksnnHanoKbYxCLnTdwlPlYIeXCQuzAo=; b=NUKe7m154RACyFxE/BsYVTHsM+7z19YuU1au+5V0prlFmNfBtv35ChQeOuXhYQOYCj 3CI6C3YYYH+MGvrU4CJQoxjLKPPuYRH83yoXKkUz5TngBc6ExqMocojFL9lNfe6EtCb4 NQXG2ESRU+N6+MRDUKE738qzQyf48T+vksFsfbo6qmp8etFfjSUlM0lk2MQdIyza5T66 HCje7fK+NkTwTzSR8XM2FO+NO2PoEkYObT21FdKUCVpxGxSIXhwSzQ7EwedFlomQ/qe2 hKgPU0y26HfWMJdo6D4SMQCwRVP2J3t88rzwzFaxca2EBYIIFyfvCriCbNDWSHq0ZPoJ MSpg== 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=zSiFncf9bc1IksnnHanoKbYxCLnTdwlPlYIeXCQuzAo=; b=l3Zkla0h1iHZHUgZqYP1zkeYw6TqnHRuDH8ESBOSh+PqXUsENAUM+kHvF4nXbjwnqd 48sGYAQXCVVKlrVJiSgGeKexHnk9V2y7r39U+ULG8EbGl7ZsBi8DL0TvjgrBceq5AE7u BVBVW6uj3roEHtO6u3ZT8pjbLEhyogrP4ML4v16GpZzUK6C7MAjbZ0abD3Fd7ZFqt1wr j6FReZWg+x8ddh3anpkIwwNa0eQPYtfN3NoznxGfos5kAW5b9lcsMHVk0uvrNh5sYlQT 87ngPrATIsWmFPPrNLYRArohDgD1KiCUa+8+LYU9PRQr1c8IT1OVTfsdWbb7O+J4q1+u unkg== X-Gm-Message-State: AOAM530u5CDU7qqD6gv7q5Q9tl5EQRDMnD4JhwbP2ly1inkICeeh5kwj ZYp+tYN2Y2nO8WRQ5OiMndKJukyyMKSMRQ== X-Google-Smtp-Source: ABdhPJypSxXb5nWWg6zFc4F311ljR6V39mAg0gur2Z3gKt7vFFgkNKvnCs1Fp44NFAGk3rNiuZKADQ== X-Received: by 2002:a63:1b42:: with SMTP id b2mr2745121pgm.401.1607095286645; Fri, 04 Dec 2020 07:21:26 -0800 (PST) Received: from localhost.localdomain ([211.108.35.36]) by smtp.gmail.com with ESMTPSA id d20sm2407286pjz.3.2020.12.04.07.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 07:21:26 -0800 (PST) From: Minwoo Im To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Minwoo Im Subject: [PATCH 3/3] blk-mq: fix msec comment from micro to milli seconds Date: Sat, 5 Dec 2020 00:20:55 +0900 Message-Id: <20201204152055.31605-4-minwoo.im.dev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201204152055.31605-1-minwoo.im.dev@gmail.com> References: <20201204152055.31605-1-minwoo.im.dev@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Delay to wait for queue running is milli second unit which is passed to delayed work via msecs_to_jiffies() which is to convert milliseconds to jiffies. Signed-off-by: Minwoo Im Reviewed-by: John Garry --- block/blk-mq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 69771ba18f1f..284d103bd0e7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1594,7 +1594,7 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx) * __blk_mq_delay_run_hw_queue - Run (or schedule to run) a hardware queue. * @hctx: Pointer to the hardware queue to run. * @async: If we want to run the queue asynchronously. - * @msecs: Microseconds of delay to wait before running the queue. + * @msecs: Milliseconds of delay to wait before running the queue. * * If !@async, try to run the queue now. Else, run the queue asynchronously and * with a delay of @msecs. @@ -1623,7 +1623,7 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, /** * blk_mq_delay_run_hw_queue - Run a hardware queue asynchronously. * @hctx: Pointer to the hardware queue to run. - * @msecs: Microseconds of delay to wait before running the queue. + * @msecs: Milliseconds of delay to wait before running the queue. * * Run a hardware queue asynchronously with a delay of @msecs. */ @@ -1687,7 +1687,7 @@ EXPORT_SYMBOL(blk_mq_run_hw_queues); /** * blk_mq_delay_run_hw_queues - Run all hardware queues asynchronously. * @q: Pointer to the request queue to run. - * @msecs: Microseconds of delay to wait before running the queues. + * @msecs: Milliseconds of delay to wait before running the queues. */ void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs) {