Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp101390rwb; Mon, 26 Sep 2022 15:28:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TLNhgRD3M2LVEYxim8PCbybAV7SILLeelssji2hzB620Y/HXie7qchDS6JAp7IG03VuiI X-Received: by 2002:a17:903:284:b0:178:2a94:9b6a with SMTP id j4-20020a170903028400b001782a949b6amr24632634plr.135.1664231311081; Mon, 26 Sep 2022 15:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664231311; cv=none; d=google.com; s=arc-20160816; b=OgihGnCYwPUWExYbJVXamHV1lRnrWDBo9sgn8UhGrLotw5MVqqy0T4yNoA/zKSbBt5 0ZkoqRS8xTgTO1SLneuwBbOI9FwtVp9x9jw9rILwCnV/g1GK3a+Ma6Yj+YTsQokbUMVs nGlZ57AzDxuVK2E8G/g8wIgtpylNROPm5GB4BMsT5SpZ7VxrzJBKNsRyK4xrYUqJzgL4 9qe18cAVu7LrPbDhJsmDGNBa07i+Bz03Cx3rREZwZjiY3d/WqEzAZYofO5u2s4z1JmSJ HQ4vnSVgk0Sf/9ZdhLq9XOthuSab0ruvqVAOj7UslcOHO74oDHruBEhtZZsFqiXH2jVW XZxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VO9kIGBomtZbV0n2IUM5HAAlzgHy/MoeouO8NuU3pAo=; b=spJ6yR5z/zxht9S1vTYLIhLgf4/NaAHBO9z4FGH0riSHInmn1BbDP7EWfnz5REmu3Q D6qLcvpIF0IuFpiDziQloiV9e55wpbcDEdrRjr4MjrCZAkPIyeA476SkebEt7y0LpFMu AE+oYMmpLianyWeVbxsw050ZQG6aJ2yi964HejDcypZApyElLtkAyXgpZJZHdJCaD8Mt JA6nGs2zV53QrWZ44OLnNi+HB2jaSfwjiO1Trsnp0spg9OEgB+8NAy1OxM2VLNS1rjKJ 6e9CMuDaJ/K1A163lWShyuxue7kKzHNzg1wB5ruVs57PixxSC9X7LlH9yifFoAd6/ESH ueqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=af8cjsel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a17090ac20a00b001f54cedede2si12689311pjt.13.2022.09.26.15.28.17; Mon, 26 Sep 2022 15:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=af8cjsel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiIZWB7 (ORCPT + 99 others); Mon, 26 Sep 2022 18:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbiIZWBq (ORCPT ); Mon, 26 Sep 2022 18:01:46 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23D28E172C for ; Mon, 26 Sep 2022 15:01:40 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id x15-20020a17090a294f00b00205d6bb3815so197465pjf.4 for ; Mon, 26 Sep 2022 15:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=VO9kIGBomtZbV0n2IUM5HAAlzgHy/MoeouO8NuU3pAo=; b=af8cjselPcStmvVCg3qezRR3fcj7wTDAlkgJDJbhbjS8Z8mk2Ao94i0ddHnRnskC+B xB5JVyLS/BmL1dQpV3IVsajZ0x2/jQi1l+fhJH6u2diGXhGk/YNo5d7z9MYJa462LHqh llkbVCduAxFjdJY+pryKoGYmBxtancZV11/4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=VO9kIGBomtZbV0n2IUM5HAAlzgHy/MoeouO8NuU3pAo=; b=WidGBuztVkh9g/Wnn6aIV/aZpDiPZdzQBwBPXKw3BFgoUcWDIFhcMTHGQ4gVFtBdju tJiOZAPJ1fdvwtK+FgXcaMflnCcEuC8j42Xi42sJM86RqlyVMoELDhOiqRfYHJM5F2H/ Z8vv6nKW3xyRT5Tq9Au3OJr4cZpQQJxnGWxPT3rfDpRoqEHXCHmhMhD9WkUf6oEEAkRB BWETiApP17kiOQqolXDtdb11KsswDUHOAd53y4yet0pfJUQSYb1XVOYRxBHz/O7cin80 VBz0y4+3ed4l4Sc+B8C2B2FI6Jxg32TlvQHfIPPwEuNz6at8cizbCsXZ+M57Vz/x5DTP hSvg== X-Gm-Message-State: ACrzQf1gXgVYGGe20qe8c4CKG37jW5gVNkUtb+MgpiEC+X9XJhZTvoFL l3UPlpr5cM+0pIBaxQvZx38pW1bokLE5vQ== X-Received: by 2002:a17:902:680d:b0:176:9f46:bebb with SMTP id h13-20020a170902680d00b001769f46bebbmr23731973plk.122.1664229700208; Mon, 26 Sep 2022 15:01:40 -0700 (PDT) Received: from khazhy-linux.svl.corp.google.com ([2620:15c:2d4:203:386c:e0ff:829b:40eb]) by smtp.gmail.com with ESMTPSA id cp2-20020a170902e78200b00178b77b7e71sm11671303plb.188.2022.09.26.15.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 15:01:39 -0700 (PDT) From: Khazhismel Kumykov X-Google-Original-From: Khazhismel Kumykov To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Khazhismel Kumykov Subject: [PATCH] block: allow specifying default iosched in config Date: Mon, 26 Sep 2022 15:01:34 -0700 Message-Id: <20220926220134.2633692-1-khazhy@google.com> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting IO scheduler at device init time in kernel is useful, and moving this option into kernel config makes it possible to build different kernels with different default schedulers from the same tree. Order deadline->none->rest to retain current behavior of using "none" by default if mq-deadline is not enabled. Signed-off-by: Khazhismel Kumykov --- checkpatch suggested more verbose help descriptions, but I felt it'd be too much repeated from the main config options, so opted to leave them out. block/Kconfig.iosched | 28 ++++++++++++++++++++++++++++ block/elevator.c | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched index 615516146086..38a83282802a 100644 --- a/block/Kconfig.iosched +++ b/block/Kconfig.iosched @@ -43,4 +43,32 @@ config BFQ_CGROUP_DEBUG Enable some debugging help. Currently it exports additional stat files in a cgroup which can be useful for debugging. +choice + prompt "Default I/O scheduler" + default DEFAULT_MQ_DEADLINE + help + Select the I/O scheduler which will be used by default for block devices + with a single hardware queue. + +config DEFAULT_MQ_DEADLINE + bool "MQ Deadline" if MQ_IOSCHED_DEADLINE=y + +config DEFAULT_NONE + bool "none" + +config DEFAULT_MQ_KYBER + bool "Kyber" if MQ_IOSCHED_KYBER=y + +config DEFAULT_BFQ + bool "BFQ" if IOSCHED_BFQ=y + +endchoice + +config MQ_DEFAULT_IOSCHED + string + default "mq-deadline" if DEFAULT_MQ_DEADLINE + default "none" if DEFAULT_NONE + default "kyber" if DEFAULT_MQ_KYBER + default "bfq" if DEFAULT_BFQ + endmenu diff --git a/block/elevator.c b/block/elevator.c index c319765892bb..4137933dfd16 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -642,7 +642,7 @@ static struct elevator_type *elevator_get_default(struct request_queue *q) !blk_mq_is_shared_tags(q->tag_set->flags)) return NULL; - return elevator_get(q, "mq-deadline", false); + return elevator_get(q, CONFIG_MQ_DEFAULT_IOSCHED, false); } /* -- 2.37.3.998.g577e59143f-goog