Message ID | 20230527010644.647900-4-yukuai1@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp63240vqr; Fri, 26 May 2023 18:22:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pWvP0y9WHN3+bpPY/SOUaqs6mSt3ywsysKyb+B39Ofm9VdVr+0v5Z621ZbiSkecgMlSuJ X-Received: by 2002:a17:90a:648e:b0:250:648b:781d with SMTP id h14-20020a17090a648e00b00250648b781dmr819039pjj.23.1685150537787; Fri, 26 May 2023 18:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685150537; cv=none; d=google.com; s=arc-20160816; b=mpnuqQeV7iJKReOXf9VevYANEBnwVNaCmmW2EyM72snlEBikT8g3WnY5jH81URm1iJ brCQQDqHqS75SUZSlb0UkudKdGcZMcB0UwbOiLgeIRplHBTM3T6MupL1zBUreXuOu/Gf KZ/iGpbbMwzJygFjfkxUR4NggmlqmMid7NAPLawkW70DZyPm35e1n0n+77a3pyCzN6bJ BFUc5IInpuBbeanUItz/8lX8yqgPrE5LxBtPzfIg38LOgwdscmxFYp/05bvbiMJvQbUf kEbQq6d5K4AE3Jy62JGTQxG3mqHqRsvtNp9dRyASDeU2RHyxSSufkrWulTeZPbGaAB92 GrNg== 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=ijyuJMI7f9fnDeOMsK0WJ06ZpeMSgMPWmfnZPpfdX+w=; b=jKdp2+0+ZD6IDbF0VoEj0VDkmCo048PUNby/KFmsCocGi0nn9tO+ndP3bZwijOe5kc FdmfED0rUqZFmeXm0+dPsZQp3Ydm/cFeiCD2RNiUANJ5GUn4tHznrRLPcbUmEitK0WlL zGFP+2gCYW5dRLA8/02dIdeQvXJ9IPLQsKWpgldpIb+hVyV9qXw/SAJ76rMrLJGnYLOg 2CMxZ8RgOljzDre6TcCZu3XIkIhUatRmcmhEwl98iAro1dnSOCyk8CVVYXWTN6MXf6eF 9gScQHeKIs/m9c6tVsxsGgE41WrFCWGZmo2H06GMeqWDsUWSQQXhw/E+/89j8d5TqQDM B3jw== 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 q21-20020a17090aa01500b002564870bcb6si791741pjp.183.2023.05.26.18.22.06; Fri, 26 May 2023 18:22:17 -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 S231531AbjE0BKZ (ORCPT <rfc822;zhanglyra.2023@gmail.com> + 99 others); Fri, 26 May 2023 21:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjE0BKT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 26 May 2023 21:10:19 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1904B19D; Fri, 26 May 2023 18:10:18 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4QSkH927ZCz4f3s5t; Sat, 27 May 2023 09:10:13 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgCH77J0WHFkNZwtKQ--.29147S7; Sat, 27 May 2023 09:10:15 +0800 (CST) From: Yu Kuai <yukuai1@huaweicloud.com> To: hch@lst.de, axboe@kernel.dk Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next v3 3/5] blk-wbt: cleanup rwb_enabled() and wbt_disabled() Date: Sat, 27 May 2023 09:06:42 +0800 Message-Id: <20230527010644.647900-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230527010644.647900-1-yukuai1@huaweicloud.com> References: <20230527010644.647900-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCH77J0WHFkNZwtKQ--.29147S7 X-Coremail-Antispam: 1UD129KBjvJXoW7urW7uFykGw4DGw18Kr1xKrg_yoW8Xry8pa nrGry7Kr4qgry0ga1xAFZrXrWfCw4rtr17GFWDu3ySk3WrArya93Z5Cry8XF4kZrZ5Ca13 Jw1ayr9xJF1q9rDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd8n5UUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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?1767008410539405858?= X-GMAIL-MSGID: =?utf-8?q?1767008410539405858?= |
Series |
blk-wbt: minor fix and cleanup
|
|
Commit Message
Yu Kuai
May 27, 2023, 1:06 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com> 'wb_normal' will set to 0 if 'min_lat_nsec' is 0, and 'min_lat_nsec' can only be set to 0 through sysfs configuration where 'WBT_STATE_OFF_MANUAL' is set together, in the meantime, they can only be cleared together through sysfs afterwards. Hence 'wb_normal != 0' is the same as 'rwb->enable_state != WBT_STATE_OFF_MANUAL'. The code is redundan, hence replace the checking of 'wb_normal' to 'enable_state' in rwb_enabled() and reuse rwb_enabled() for wbt_disabled(). Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> --- block/blk-wbt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index cb464c572840..06d400fa050d 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)