From patchwork Fri Nov 25 15:53:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4118301wrr; Fri, 25 Nov 2022 07:54:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NqxgGgK/G1PnEdAoRS6ZOCp+AvhyAW7XtqL9JcHzfT4g1q59SOaWiCFfZeYYrqi3nQw7y X-Received: by 2002:a05:6402:f10:b0:467:9976:2e37 with SMTP id i16-20020a0564020f1000b0046799762e37mr36145077eda.267.1669391677610; Fri, 25 Nov 2022 07:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391677; cv=none; d=google.com; s=arc-20160816; b=YkekwzyvV6tNL0F83myMqSVNU43UtYL1206licpy+eWDG1V87edTABUtESNohr6fQR U1I0ekh7m+RFaZ6SkMRS/YSefXH5ugqANyiBt7lQvSlWYfbTHRmSnxiAT41DB9YJ+TXC mZN4GXC4mT8ncNAD+1SSYitV8UB6S5IElv0SoBmahxbGiufyTFtmuRnktCBtctyeafNb 1t+n0CkVlhKQwMTziCkyRnjQ7hIsmQqCbPyz8x/nDbriu6ET1lqjB1yY16GiILVRdFD+ eae4PhPGoSmJxf5vJCw+fqz+vZ5qqXs+6RfJSTmGHr1YqENypAjxTYATS1/Pcl1jH7Tp zWag== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dBI9dWjX09z0uU25CnxC5YMz933s2WnelZgltN5jMPE=; b=KlHJxxEt/QqwcH9VmhecCoQr3sZCy7hm/OI8RTd7C2AC4dlf60JLzAum39utixoWn0 V8u6KSNDQ/MJK0Jf0GC6eW/dVJ97F1b97+fvcjk9BFsfRE47lBDBlG9t2n11jm8Y+va7 FYUkohZcLQqztSavj2s6mHBz7g8wCTk7pQbJSnQEWM8/qjpTIMvtSzkG+wy0bZAJ+puw y3gaRRS+A4cM8IUuMOnteyUlUEQM3MpUhBLZreK9JE6ABwsh6Ha8ISpgXyhc+G4nGXeP mWEwTOeSz6e7njfQnJ4rY8OG0PVdFTfo5TW9SFycC+17NXETUtXI8EL2L+XNOTbwt9P/ 6G6w== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di10-20020a170906730a00b007417c6edb0asi4028502ejc.402.2022.11.25.07.54.12; Fri, 25 Nov 2022 07:54:37 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiKYPyA (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbiKYPxk (ORCPT ); Fri, 25 Nov 2022 10:53:40 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2AC1E4AF04; Fri, 25 Nov 2022 07:53:29 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S3; Fri, 25 Nov 2022 23:53:26 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 1/4] elevator: print none at first in elv_iosched_show even if the queue has a scheduler Date: Fri, 25 Nov 2022 23:53:11 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S3 X-Coremail-Antispam: 1UD129KBjvdXoW7XFWfuFy7Kry7CryfAw4rGrg_yoWDAFXEqF ZYq3Z7Jw45J34UCF4jyF1xtFWFvws3XF15Kwsrtr97Ja15Ka4jyr1xuFs8J34DGFWUua43 A3srZ3s7AwnFkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIkFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2 jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4 vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E wIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf 9x0JUQZ23UUUUU= X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEDB1ZdtcjbFAAHs5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484047827119906?= X-GMAIL-MSGID: =?utf-8?q?1750484047827119906?= This makes the printing order of the io schedulers consistent, and removes a redundant q->elevator check. Signed-off-by: Jinlong Chen Reviewed-by: Christoph Hellwig --- block/elevator.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 599413620558..308bee253564 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -767,10 +767,12 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) if (!elv_support_iosched(q)) return sprintf(name, "none\n"); - if (!q->elevator) + if (!q->elevator) { len += sprintf(name+len, "[none] "); - else + } else { + len += sprintf(name+len, "none "); cur = eq->type; + } spin_lock(&elv_list_lock); list_for_each_entry(e, &elv_list, list) { @@ -783,9 +785,6 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) } spin_unlock(&elv_list_lock); - if (q->elevator) - len += sprintf(name+len, "none"); - len += sprintf(len+name, "\n"); return len; }