Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3198056rwo; Fri, 4 Aug 2023 00:30:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCurZ4C8X5a0k23/sawHHdJWgYI1Ne1di/kH1F51XVonWH9jCngvrRcZhXNYBv0dIwQjKN X-Received: by 2002:a17:902:d904:b0:1bb:2020:be0d with SMTP id c4-20020a170902d90400b001bb2020be0dmr980290plz.14.1691134245775; Fri, 04 Aug 2023 00:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691134245; cv=none; d=google.com; s=arc-20160816; b=ftBTfJB3RR0cRdKWULxgmVmFaIarDreO8q7iQpBKZvw/HRQxOAD5Hmg0h3JEEKuY+U CNHoeKpmwLfVYmQXp2Br3neOn1Sra2KcBSI86xlKXN9KrZJCDSRTfhhM6z61NpUxwSHi UyPMFZskutRt8Y/uJHKFPR79sl8skGocckfU9QN3a4oZQscCpW/2sF1uCBUmiqX1ZFkM OVaTzp06hkXx4SPT9024wb+d2sb5M1GPc8iD1JJeahzDWXmtTR5F+lKK4fbNFMQj+5cj oxL5A3msB7Hp1p80eoVsHbZWmKmr4hi/JgOSvcHi23RyFJ2uNePELZ/Y26VQBxuYmDfv kQJQ== 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 :dkim-signature; bh=OzB+tj5WG2nRg5qjnj2AfK3ycFx9pV+276EIl9UNjzI=; fh=trl8IP3/IStrfUzErWPHTQPip+nFa0aNkVvc3yxpI3E=; b=RHf7F7WDFxegwc3t6t7v0RGHaTe49n6wgef81+1+RqSyTv+t6IeSJahFxMmgop0amg vm/gi8RpZlHeFqIms1MUf6cpxhTKIX5dJbyPRnfK5jt6RrohTSAog76fJAav/Wuwdg/f 7x/frWu/xvAYbSAbMnC0h+Heeuh4CtO+Yp+Aok3YkC5sEz3aSPxRDK5MGzO8+xjz8t4L pbMvmYpxcnjvPFoaEcO5Flauewukjhp2fCEBII35ccimG4+MaKjXkQk736zJ2yDn7ZNX BVfGIviMK2wLMOeoxDE2wQE+zzakXmh81DoiPk4Bfc35REupPvmE7UD0ZrGHZKzlTqmY 5Fgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YLZj7PyQ; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a170902a40b00b001b03d54354dsi1284543plq.189.2023.08.04.00.30.33; Fri, 04 Aug 2023 00:30: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; dkim=pass header.i=@linux.dev header.s=key1 header.b=YLZj7PyQ; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbjHDGvr (ORCPT + 99 others); Fri, 4 Aug 2023 02:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233890AbjHDGvV (ORCPT ); Fri, 4 Aug 2023 02:51:21 -0400 Received: from out-123.mta1.migadu.com (out-123.mta1.migadu.com [95.215.58.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA6F49E5 for ; Thu, 3 Aug 2023 23:50:58 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691131856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OzB+tj5WG2nRg5qjnj2AfK3ycFx9pV+276EIl9UNjzI=; b=YLZj7PyQ1W40IvVqKAz4telK3UOEU755Km77YnQbv6fHLPvZQLj4HLBy8qQgXP4ZtwjJOn o0KkbrYXbekt3SbDYkjwl7DygkR0L1YXDxsqPO5tw2ancYRZnm9ZoDzWy/FdaabEwqnrSZ 6LQs+S8cUSey6argktmIpAW7y+RW5Gg= From: chengming.zhou@linux.dev To: axboe@kernel.dk, tj@kernel.org Cc: linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: [PATCH 2/3] iocost_monitor: print vrate inuse along with base_vrate Date: Fri, 4 Aug 2023 14:50:38 +0800 Message-ID: <20230804065039.8885-2-chengming.zhou@linux.dev> In-Reply-To: <20230804065039.8885-1-chengming.zhou@linux.dev> References: <20230804065039.8885-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Chengming Zhou The real vrate iocost inuse is not base_vrate, but the atomic vtime_rate. We need iocost_monitor tool to display this real vrate that iocost use, to check if the boosted compensated vrate is normal. Effect after change: nvme0n1 RUN per=50.0ms cur_per=172116.580:v1040587.433 busy= +0 \ vrate=135.00%:270.00% params=ssd_dfl(CQ) ^ | this is real vrate inuse Signed-off-by: Chengming Zhou --- tools/cgroup/iocost_monitor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cgroup/iocost_monitor.py b/tools/cgroup/iocost_monitor.py index 7aa076cb559e..52ae9d1595b2 100644 --- a/tools/cgroup/iocost_monitor.py +++ b/tools/cgroup/iocost_monitor.py @@ -100,6 +100,7 @@ class IocStat: self.period_at = ioc.period_at.value_() / 1_000_000 self.vperiod_at = ioc.period_at_vtime.value_() / VTIME_PER_SEC self.vrate_pct = ioc.vtime_base_rate.value_() * 100 / VTIME_PER_USEC + self.ivrate_pct = ioc.vtime_rate.counter.value_() * 100 / VTIME_PER_USEC self.busy_level = ioc.busy_level.value_() self.autop_idx = ioc.autop_idx.value_() self.user_cost_model = ioc.user_cost_model.value_() @@ -119,7 +120,9 @@ class IocStat: 'period_at' : self.period_at, 'period_vtime_at' : self.vperiod_at, 'busy_level' : self.busy_level, - 'vrate_pct' : self.vrate_pct, } + 'vrate_pct' : self.vrate_pct, + 'ivrate_pct' : self.ivrate_pct, + } def table_preamble_str(self): state = ('RUN' if self.running else 'IDLE') if self.enabled else 'OFF' @@ -127,7 +130,7 @@ class IocStat: f'per={self.period_ms}ms ' \ f'cur_per={self.period_at:.3f}:v{self.vperiod_at:.3f} ' \ f'busy={self.busy_level:+3} ' \ - f'vrate={self.vrate_pct:6.2f}% ' \ + f'vrate={self.vrate_pct:6.2f}%:{self.ivrate_pct:6.2f}% ' \ f'params={self.autop_name}' if self.user_cost_model or self.user_qos_params: output += f'({"C" if self.user_cost_model else ""}{"Q" if self.user_qos_params else ""})' -- 2.41.0