From patchwork Thu May 28 08:10:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 187290 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp388449ilb; Thu, 28 May 2020 01:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBPvHNZd9jqBWVl/tSj2nix9d1ypT9usOgo9fu2E+P9US6GurMe3Pea4cd8kMaDLDKTef1 X-Received: by 2002:a17:90a:b111:: with SMTP id z17mr2521608pjq.106.1590653552075; Thu, 28 May 2020 01:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590653552; cv=none; d=google.com; s=arc-20160816; b=orH5dkuDSsuQfi2Q3ffILlgCV2nW6wEHptm2U4Ekvj4WLZuhQD15RqmIELeUNqeUcJ ILbdB+ye4oqw0tOY7SbBL5aanl13IIeRagXd0yKCc3K1evseTHHsUMAz8fy0HLawkyCl j7bv6BZaBsga21rKCEVj4OKk64cGIcbHcFh1jhK4hSVMHvoWr/Cys/L5SZFxwY32tDhL 0jowwf1xvrL1G5Mjzso4lzObuvZYyH3FYX+fQon8JgSFA9zeFzXzzWDeo0VFRwFbQUCe zRfwUVFxea60HLU5hWZ/idD0Ob7/2J9P6iL2gTJ5L3dBQ5nnjLU9o5eLdPPDOPe4j1Yh QJkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=eV596mcWc4x7JgdROAAWb500jvYBj1hB3nF/ReDZb4o=; b=UU2iBZi/ghHONcFWjgXaamA63TfjaL34qvmm4C5KnNMwxPQ043iw2BB37y7eBu1zBK lndaLmvkeVaaybPujqvCjg+hj76EGtEHeZHmlEDXYDxHYpelEy3FRKmLNeGR3Kj8XYbz +azAPG0C4w1Rsxwgy6EdPaB5r73NdnBGfJj+v2KE8a7G2W6/lQ5WH9IkBWu7KxtaFE4i 6V7NxqgvsOyjhPMWige639Ppm+yeXnD/9qhTZXmBqo3vsgDIsKm06Sqs0pdxFOnBUaLa jddE0NlEI/xUjRpcQIi9MWS05aS2qKnrz+ongvPi9BGAy7y9DxaSSqEQqRHGABnEpaTf vBAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=fFEWiIBU; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hYFrV6hn; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 207si4315563pgf.203.2020.05.28.01.12.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 01:12:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=fFEWiIBU; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hYFrV6hn; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=eV596mcWc4x7JgdROAAWb500jvYBj1hB3nF/ReDZb4o=; b=fFEWiIBUvb43K9 cgsAKQpbiRyUiuVZXxoDwwXdhZC3OFilKmpzGqZIq5g67wRl4PXUZ3PVfi3H6TzSUywcCvwDldF/U xmDt6jIQVevtQ0kmi31isKO4l3VjKrGtam/CW0I8OijX5GAp82at9Aw46E3Yqv7Q069kZpKLdxnPN s1NZh26UEYHdkJZLivQKqIimEMVGUnkgOxY7DjPrbbfD5DduOcGx9JZVJ0088i94ShV5IbiVCg+Od z/ohDeq1ML+hrt9odtMmp9NrVqOuHqZo1Dh5ExdANaMMUgIG/0LOdmxypSUkVbJRCH44M312R2rsH GvJYMxah1dm0JVx5bXlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeDeJ-0006DK-CG; Thu, 28 May 2020 08:12:23 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeDe5-00062A-Q4 for linux-mtd@lists.infradead.org; Thu, 28 May 2020 08:12:11 +0000 Received: by mail-lf1-x144.google.com with SMTP id w15so16001898lfe.11 for ; Thu, 28 May 2020 01:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RQk00OdF5LpL5xlOXSrSDqS1InuSH/j3c3d+RMcDSME=; b=hYFrV6hnyOyM0TqXYVyo29Mpe9PYRzNEp8rLaIglftrYmaU+1sviJPkAq8BJWc6y/w yhY1Pk1ezuwKQRUlNTJu5vNwOoExi7sUy5E0WVr5C/E5gWVz3Z/4o/hfAXYgt35nHeuC SWR+WWvBvCn3CoQ2xvQkyWd7+dQ4Jo0vw+Y1bJMTH07IzG6E5b5HNh0umWhC0XM09eUV Q6BxXW2N0LtoPpjqx8yJP2DrA+XVGsjEho2ebLZJmUCz1oQuS7vw7/BqumbbtQ1PJMZH A81KtK5cZOOvqgdlm0Zzvjm6iSxyfZ1/wEGXgqe7waJEyfZG91NLA/B9SY6hsl34z0Wg 8HJw== 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:mime-version :content-transfer-encoding; bh=RQk00OdF5LpL5xlOXSrSDqS1InuSH/j3c3d+RMcDSME=; b=ExQ5tQ4ZjtoEYMNHLbZMhQD4bo417oO5jSm9ndgZbMMFY8nhO6KwXReAxBLutqwQHj 1QI+bseQihtEXlmUH6+0AU60syLhx1XbkDjIlIEWwiLbUrff+R2ijdABYitIC87NyXlp 5T4UkWUpJFVxHdXEeFlHc6n8soLXE4EJ5jnd/8mPYgi8MRJ/J0GqIJBQryLuDCi4f7my XdWqMI8ssAnTfOscaNXa40VJH+vFGSJFLbhWDgXcYxBoWADIBYGOnTeciGbAgBPuXqTk W2QS9nFKkXdqpHgFXVsux+W2mMZPtfyTql4crPWpXQwA1JyC50xY8wyIJRepNKLjlmyP wujQ== X-Gm-Message-State: AOAM533AIB8RHcId+JHBzqP/Cz0CsTlgNJ4WycZ9ezTXfeRbuFlGi9Et +Va+uBIMhLc6VIapRRXsaf9SuA== X-Received: by 2002:a19:c616:: with SMTP id w22mr1020281lff.123.1590653527967; Thu, 28 May 2020 01:12:07 -0700 (PDT) Received: from localhost.localdomain (c-8cdb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.219.140]) by smtp.gmail.com with ESMTPSA id y11sm1289351lji.52.2020.05.28.01.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 01:12:07 -0700 (PDT) From: Linus Walleij To: linux-block@vger.kernel.org, Jens Axboe Subject: [PATCH] block: Flag elevators suitable for single queue Date: Thu, 28 May 2020 10:10:03 +0200 Message-Id: <20200528081003.238804-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200528_011209_910096_343A1BDC X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Le Moal , Paolo Valente , Linus Walleij , linux-mmc@vger.kernel.org, Ming Lei , linux-mtd@lists.infradead.org, Johannes Thumshirn , Christoph Hellwig Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The Kyber block scheduler is not suitable for single hardware queue devices, so add a new flag for single hardware queue devices and add that to the deadline and BFQ schedulers so the Kyber scheduler will not be selected for single queue devices. Deadline and BFQ are applicable to single HW queues so flag each of these as single HW queue-friendly. Cc: Johannes Thumshirn Cc: Christoph Hellwig Cc: Ming Lei Cc: Damien Le Moal Cc: Paolo Valente Signed-off-by: Linus Walleij --- block/bfq-iosched.c | 1 + block/elevator.c | 3 +++ block/mq-deadline.c | 3 ++- include/linux/elevator.h | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) -- 2.25.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ Reviewed-by: Johannes Thumshirn diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 3d411716d7ee..7bf99fd83472 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6812,6 +6812,7 @@ static struct elevator_type iosched_bfq_mq = { .icq_align = __alignof__(struct bfq_io_cq), .elevator_attrs = bfq_attrs, .elevator_name = "bfq", + .elevator_features = ELEVATOR_F_SINGLE_HW_QUEUE, .elevator_owner = THIS_MODULE, }; MODULE_ALIAS("bfq-iosched"); diff --git a/block/elevator.c b/block/elevator.c index 4eab3d70e880..ebb4fc875b86 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -678,6 +678,9 @@ void elevator_init_mq(struct request_queue *q) if (unlikely(q->elevator)) return; + if (q->nr_hw_queues == 1) + q->required_elevator_features |= ELEVATOR_F_SINGLE_HW_QUEUE; + if (!q->required_elevator_features) e = elevator_get_default(q); else diff --git a/block/mq-deadline.c b/block/mq-deadline.c index b490f47fd553..324047add271 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -794,7 +794,8 @@ static struct elevator_type mq_deadline = { .elevator_attrs = deadline_attrs, .elevator_name = "mq-deadline", .elevator_alias = "deadline", - .elevator_features = ELEVATOR_F_ZBD_SEQ_WRITE, + .elevator_features = ELEVATOR_F_ZBD_SEQ_WRITE | + ELEVATOR_F_SINGLE_HW_QUEUE, .elevator_owner = THIS_MODULE, }; MODULE_ALIAS("mq-deadline-iosched"); diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 901bda352dcb..03057fa2f569 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -172,6 +172,8 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t); /* Supports zoned block devices sequential write constraint */ #define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0) +/* Elevator is suitable for single hardware queue devices */ +#define ELEVATOR_F_SINGLE_HW_QUEUE (1U << 1) #endif /* CONFIG_BLOCK */ #endif