Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4617806rwj; Tue, 20 Dec 2022 12:41:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXsm/QikWHpI/3/vgv9W9DtSq0lvTvrekZHXMLf9t5Ka335K45bppzFWIfxZnPlmZb0nRJ9m X-Received: by 2002:a17:90a:69e5:b0:20d:bd60:adab with SMTP id s92-20020a17090a69e500b0020dbd60adabmr16850857pjj.39.1671568904376; Tue, 20 Dec 2022 12:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671568904; cv=none; d=google.com; s=arc-20160816; b=ST38jngKttDz0uoR6l2nd34UEH19Cim2vIoWHqPk6VABOxnAQ5BJg2UHK2fEAX3JLb EBVROiJeiIsOO8hKfg6qlCzexK7NdkpnIxfaZqGy6ncNbOA49RZpjAlULOObupLX2YHm 3ZcisWkIwo854qJYBgGgXYliyOxPav7rwg8hEpszjb9MJvJsRO8xBsYanRzMcZxg1SKH jbdgqLRxacoucyeEIMedrqpWjR2WnvHm2+pRo7VG9/xXVkmr+SeAi35Y2nrLFNBT9Y4x EzXyvDm21UJGJQcJgO61l4b3+KhzQkMg9JivVz0JeyQlAXtc8eialGOwLF+o5rABVPe1 NMXg== 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; bh=FUMcfBa2XKxZZA9An8IFXz+LFmohn7F0tDiP3zdCIc4=; b=kmxdadXnsK622pWuk2nEBYfV5HjEJJe/XfBFpPYCsrdBBp4gXWGv70fWVIe4mVQZwX dtZrhLLRJX8vjcUJdaNYVFvbJTQ5a4J1WZt/ZMtcw3ffV1rSN0peJ696H9DB39tbeoFq dgX9Xqvid5nzpEXdEYq+t5CVRHp6wEAKYQvMseuDZp6rgx6cifC48/JLqyhNMXpzvq6U 0/23ePplEcRZhO3B1N5ZEDcWimd8q/uTcboYIJ++DJ3Bzq5ixNS2Iw+e+HGnoh6S0G+y Y3C4gps1AcUObgqmTtOluqjJATixMZd4o1XPdN4yimJqkBINZTXzIrBlEJDtzUfxssbb jmaw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a17090a130600b00201d6d4cc79si19561787pja.113.2022.12.20.12.41.35; Tue, 20 Dec 2022 12:41:44 -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 S234297AbiLTUUc (ORCPT + 69 others); Tue, 20 Dec 2022 15:20:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234291AbiLTUUA (ORCPT ); Tue, 20 Dec 2022 15:20:00 -0500 Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B5FB1FCE2; Tue, 20 Dec 2022 12:18:34 -0800 (PST) Received: from localhost (unknown [IPv6:2a01:e35:39f2:1220:dc8b:b602:9bcd:3004]) by smtp6-g21.free.fr (Postfix) with ESMTPS id 7B28D780350; Tue, 20 Dec 2022 21:18:23 +0100 (CET) From: Yann Droneaud To: Tejun Heo , Josef Bacik , Jens Axboe Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Yann Droneaud Subject: [PATCH] blk-iocost: don't make all constants unsigned long long Date: Tue, 20 Dec 2022 21:18:19 +0100 Message-Id: <20221220201819.1497577-1-ydroneaud@opteya.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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 My shiny new compiler (GCC 13) is reporting the following warnings: ../block/blk-iocost.c: In function 'ioc_weight_prfill': ../block/blk-iocost.c:3035:37: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=] 3035 | seq_printf(sf, "%s %u\n", dname, iocg->cfg_weight / WEIGHT_ONE); | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | unsigned int long unsigned int | %lu ../block/blk-iocost.c: In function 'ioc_weight_show': ../block/blk-iocost.c:3045:34: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=] 3045 | seq_printf(sf, "default %u\n", iocc->dfl_weight / WEIGHT_ONE); | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | unsigned int long unsigned int | %lu It appears WEIGHT_ONE enum is unnecessarly unsigned long (or unsigned long long on 32bit) because of VTIME_PER_SEC and/or AUTOP_CYCLE_NSEC need the enum to be that large. Addressed by lazy splitting the "catch all" anonymous enum and placing the unsigned long long constants in their own anonymous enums. Signed-off-by: Yann Droneaud --- block/blk-iocost.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 495396425bad..bb1f8522c0f1 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -232,7 +232,9 @@ enum { /* 1/64k is granular enough and can easily be handled w/ u32 */ WEIGHT_ONE = 1 << 16, +}; +enum { /* * As vtime is used to calculate the cost of each IO, it needs to * be fairly high precision. For example, it should be able to @@ -255,7 +257,9 @@ enum { VRATE_MIN = VTIME_PER_USEC * VRATE_MIN_PPM / MILLION, VRATE_CLAMP_ADJ_PCT = 4, +}; +enum { /* if IOs end up waiting for requests, issue less */ RQ_WAIT_BUSY_PCT = 5, @@ -293,10 +297,14 @@ enum { /* don't let cmds which take a very long time pin lagging for too long */ MAX_LAGGING_PERIODS = 10, +}; +enum { /* switch iff the conditions are met for longer than this */ AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC, +}; +enum { /* * Count IO size in 4k pages. The 12bit shift helps keeping * size-proportional components of cost calculation in closer -- 2.37.2