Message ID | 20230511014509.679482-6-yukuai1@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4046739vqo; Wed, 10 May 2023 18:52:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Jf2SUN8tTga7n62ozya4T3MDF/QyE4Kpgb3IyX8mkM5DK1JuMr2NMrQAmKKL9IdUIrZ51 X-Received: by 2002:a05:6a20:394a:b0:102:d2fa:d707 with SMTP id r10-20020a056a20394a00b00102d2fad707mr5068522pzg.52.1683769965451; Wed, 10 May 2023 18:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683769965; cv=none; d=google.com; s=arc-20160816; b=n2VMm2QX++ihaLv+ylXI5KQy5ewmQ7E2sK7PgknxzXZ87WoDQLlK7NMVt7S4uqLAHF 7g5fhDGCAFZee0cPkNYgqLLodYI4BQBHikqfc/e1GfnKe9FBqV/X0sv3pyHi3/P9YZip WLude5LlWu5OoZ36pOyNwm3rouCPwL7y9YadAG131+LNvRZsqv7x0nUCtGgubJSbI5lg 5CpBi5SlvHdLjxr0LH8E8psf04WCgoeIoFem7c1nk3mJl1olNxgD28Qu6ZDSeV1VxByB v0UnIuY38E/GouZP1CIbDTajx4NiWaoNhDQ2NUgJa+kfrR2dah8NP/DQG9UvFcDuMkwz pLSA== 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=2Uu4ZKmQ0ovo3DPHqjeCH8uEKsGBXzzAjmD/My8zO7I=; b=EKj4LiULF2/Ip4IAYMkySz9rubWe8xG0SFMXXv7T4wRMDymFqgMW78HASai/rkKRF5 YmaYqqFCZ7LlVGTNWIGdx3BOXLOE2JZWEePfhHk9gx9/uM1+jteKFSzIQhkA/90BjBQY +A3Xr2O8x5OZjoWWVLSO5yLFy3uKyZSWzBCRqys3+aEsa60+a3R1mjYSjYLSxi18Oe2N WvvTuAzr+Bxg9ffXfYAVdeEjPQh9EjuUcwDCItCQr5QInRn1CSXW4GhSRsKaZaJPNiFh 7fdqlY8VHMrwsEocEKoYVJD0GUAzF/nDoA6Vu556ZtPdzHJdnrg3SPk6CdQ91NyyEbli 0XRg== 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 v6-20020a17090abb8600b0025049be6267si12054107pjr.133.2023.05.10.18.52.30; Wed, 10 May 2023 18:52:45 -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; 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 S237108AbjEKBsK (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Wed, 10 May 2023 21:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237021AbjEKBry (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 10 May 2023 21:47:54 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 816E165AA; Wed, 10 May 2023 18:47:51 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4QGvsv1mCSz4f3lwX; Thu, 11 May 2023 09:47:47 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP2 (Coremail) with SMTP id Syh0CgA33eo_SVxkrgJdJA--.7260S9; Thu, 11 May 2023 09:47:48 +0800 (CST) From: Yu Kuai <yukuai1@huaweicloud.com> To: hch@lst.de, tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, yukuai3@huawei.com Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next 5/6] blk-wbt: cleanup rwb_enabled() and wbt_disabled() Date: Thu, 11 May 2023 09:45:08 +0800 Message-Id: <20230511014509.679482-6-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230511014509.679482-1-yukuai1@huaweicloud.com> References: <20230511014509.679482-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgA33eo_SVxkrgJdJA--.7260S9 X-Coremail-Antispam: 1UD129KBjvdXoWrZw1UWw43XF1kWryDtr13Arb_yoWDWFgEkw 18WFn7Gwn5ZrsYyF4Uuw15WFWIkrWDJF18urn3KF9ayr47JF9akw4xXr4rCrW3urWxCFy8 tFyDZry7Zr4fXjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2 IY04v7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUQSdkU UUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765560774992100394?= X-GMAIL-MSGID: =?utf-8?q?1765560774992100394?= |
Series |
blk-wbt: minor fix and cleanup
|
|
Commit Message
Yu Kuai
May 11, 2023, 1:45 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com> The code is redundant, reuse rwb_enabled() for wbt_disabled(). Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- block/blk-wbt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On Thu, May 11, 2023 at 09:45:08AM +0800, Yu Kuai wrote: > From: Yu Kuai <yukuai3@huawei.com> > > The code is redundant, reuse rwb_enabled() for wbt_disabled(). This also changes how rwb_enabled is implemented.
Hi, 在 2023/05/11 23:23, Christoph Hellwig 写道: > On Thu, May 11, 2023 at 09:45:08AM +0800, Yu Kuai wrote: >> From: Yu Kuai <yukuai3@huawei.com> >> >> The code is redundant, reuse rwb_enabled() for wbt_disabled(). > > This also changes how rwb_enabled is implemented. > 'rwb->wb_normal == 0' should be the same as 'rwb->enable_state == WBT_STATE_OFF_MANUAL', I'll explain in detail in v2. Thanks, Kuai
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 7a9a30da8650..7066fc2c1e5d 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -146,7 +146,7 @@ enum { static inline bool rwb_enabled(struct rq_wb *rwb) { return rwb && rwb->enable_state != WBT_STATE_OFF_DEFAULT && - rwb->wb_normal != 0; + rwb->enable_state != WBT_STATE_OFF_MANUAL; } static void wb_timestamp(struct rq_wb *rwb, unsigned long *var) @@ -494,8 +494,7 @@ bool wbt_disabled(struct request_queue *q) { struct rq_qos *rqos = wbt_rq_qos(q); - return !rqos || RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT || - RQWB(rqos)->enable_state == WBT_STATE_OFF_MANUAL; + return !rqos || !rwb_enabled(RQWB(rqos)); } u64 wbt_get_min_lat(struct request_queue *q)