Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp739241rwe; Wed, 31 Aug 2022 10:06:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mVFgpIYWor/m7yekHVq7qzSwQFVp7dVq8Rm2a/U2Vc22nvcVdXRrgyKh5OP08RT2gjL08 X-Received: by 2002:a17:906:ee8e:b0:730:4a24:f311 with SMTP id wt14-20020a170906ee8e00b007304a24f311mr21782314ejb.420.1661965616241; Wed, 31 Aug 2022 10:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661965616; cv=none; d=google.com; s=arc-20160816; b=zXOOQY7qayVMpnJVD4COYdL282fwDnckpRRxzGYTKrkGZmGLVrZt2oLstcZbrAOFlV 7qc6lgrVcjwgf6LxFUARmY7b1vSXrlffjkPWr/wsWqAWT9jKUTnODqvTH7uD9RxHSh4F Nahw6Vj9MHksAjj70iHs5qBkW7n39hoL0+HbM+Pil/0D6h3Gng9Z/23M404QVqVauY37 flJWs1L6CaeJZi/tYEofujmZRtZuAjRRO3L5x0Gj7bAwLPBsWsoKLXmtdj9Nlvc5efrs O+mCP2MhOMnSBdt2Sg7RY14XYfyVfWiDVa3Bc+7VGZT/i2HUtWtCyTNVfWyCgG1hDGmk Bd9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:dkim-signature; bh=/0qnttkL+CYtRVTaS49rAHU9Us+WvSecGU2DXZi0PyQ=; b=mzbZTHae+47NABerL/kfR0EjtjxeKLmFoE9OcZ3rJNRrwlQxxCdUO0sv2FS7mUqVlB 5DxJkT1iiutQGX1rOIOc3u/iMffDT/W5dp6V3dDcHd2dWDJaKTkX7CpkOchhGmhatSVz lrzCk3zSrPW0LfIthyUZGXNX2qFr/WUBdMNWCt0Vv5lms4OXQQtunFmD8y5Cb7nWbFwF i91TtIbjxDxNFL6gRPXNJYBWEqY41wmN96wIf+0eGM+f3BjGqYxQjkllVfq3QU3wnffD +8obsbP4TyD6B/+WRXjqWCT2Lx/R3K23lQ2wKhi9KPbxVzrgA6L575D4FYV/GYQufJOu 3fkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=bslYp23X; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg6-20020a1709072cc600b0073d610ccf33si11106126ejc.296.2022.08.31.10.06.09; Wed, 31 Aug 2022 10:06:56 -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=@suse.de header.s=susede2_rsa header.b=bslYp23X; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbiHaRDN (ORCPT + 99 others); Wed, 31 Aug 2022 13:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbiHaRCp (ORCPT ); Wed, 31 Aug 2022 13:02:45 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DFC5B49; Wed, 31 Aug 2022 10:02:42 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4D8B02208E; Wed, 31 Aug 2022 17:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661965361; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/0qnttkL+CYtRVTaS49rAHU9Us+WvSecGU2DXZi0PyQ=; b=bslYp23XXRYcLlhzFd9AByPhyqDerdkGWi1eNixAggLbTSOuqgP9do149pQ4bUlYGi/OLn LA70OgzUIFwsDG8Ku2swD/ySV0nQEeh6VX8vXJLqLGMU36Ca6BjSjqTQsbg0VJKol532mZ kskJFy+csx1uXISENcw5TYP2YL711Ro= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661965361; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/0qnttkL+CYtRVTaS49rAHU9Us+WvSecGU2DXZi0PyQ=; b=I5IAwqJyMQ47BgTj3yIlmzvtHclY2b0tKiJTI/jZwAC/edF4i0y96z19iKdpKHFkwVaDcv 2ZKxxqMkxXWhdfCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5A6CD13A7C; Wed, 31 Aug 2022 17:02:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SJv6Jy+UD2NuFAAAMHmgww (envelope-from ); Wed, 31 Aug 2022 17:02:39 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [PATCH 2/3] bcache: Convert to lib/time_stats From: Coly Li In-Reply-To: <20220831165437.l27raas6k5nlqsdg@moria.home.lan> Date: Thu, 1 Sep 2022 01:02:37 +0800 Cc: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F91055C-4253-42CD-8A4A-8B8EA2CF1D6E@suse.de> References: <20220829165344.2958640-1-kent.overstreet@linux.dev> <20220829165344.2958640-3-kent.overstreet@linux.dev> <14ACCED7-D24D-4AC4-8677-F7F4630A840A@suse.de> <20220831165437.l27raas6k5nlqsdg@moria.home.lan> To: Kent Overstreet X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: X-Mailing-List: linux-kernel@vger.kernel.org > 2022=E5=B9=B49=E6=9C=881=E6=97=A5 00:54=EF=BC=8CKent Overstreet = =E5=86=99=E9=81=93=EF=BC=9A >=20 > On Thu, Sep 01, 2022 at 12:00:17AM +0800, Coly Li wrote: >>=20 >>=20 >>> 2022=E5=B9=B48=E6=9C=8830=E6=97=A5 00:53=EF=BC=8CKent Overstreet = =E5=86=99=E9=81=93=EF=BC=9A >>>=20 >>> This patch converts bcache to the new generic time_stats code >>> lib/time_stats.c. The new code is from bcachefs, and has some = changes >>> from the version in bcache: >>>=20 >>> - we now use ktime_get_ns(), not local_clock(). When the code was >>> originally written multi processor systems that lacked synchronized >>> TSCs were still common, and so local_clock() was much cheaper than >>> sched_clock() (though not necessarily fully accurate, due to TSC >>> drift). ktime_get_ns() should be cheap enough on all common = hardware >>> now, and more standard/correct. >>>=20 >>> - time_stats are now exported in a single file in sysfs, which means = we >>> can improve the statistics we keep track of without changing all >>> users. This also means we don't have to manually specify which = units >>> (ms, us, ns) a given time_stats should be printed in; that's = handled >>> dynamically. >>>=20 >>> - There's a lazily-allocated percpu buffer, which now needs to be = freed >>> with time_stats_exit(). >>>=20 >>> Signed-off-by: Kent Overstreet >>> Cc: Coly Li >>=20 >> Hi Kent, >>=20 >> Overall I am OK with the change to bcache code. You may add >> Acked-by: Coly Li >> in future version of this patch. >>=20 >> In bcache-tools, they don=E2=80=99t read the changed sysfs files = (including bcache-status), IMHO changing the output format won=E2=80=99t = be problem for upstream. >>=20 >> My only question is, how to understand the time_stats_to_text() = output format, >> count: 3 >> rate: 0/sec >> frequency: 4 sec >> avg duration: 4 sec >> max duration: 4 sec >> quantiles (ns): 0 4288669120 4288669120 5360836048 5360836048 = 5360836048 5360836048 5360836048 5360836048 5360836048 5360836048 = 5360836048 5360836048 5360836048 5360836048 >>=20 >> Fro the above output, what are =E2=80=9Crate=E2=80=9D, = =E2=80=9Cfrequence=E2=80=9D and =E2=80=9Cquantiles=E2=80=9D for? >=20 > Rate and frequency are inverses - in this example, we're seeing 4 = events per > second. >=20 Can I understand that rate =3D 1/frequency ? Then frequency 4 is around = to rate 0. > The quantiles are for the duration, they give you an idea of the = statistical > distribution, see https://en.wikipedia.org/wiki/Quantile I wanted to ask how to read the quantiles line. Does it mean that 1 ns = is equally divided by 15 segments, and the counter values are for the = divided 1/15 ns segments? >=20 > In the near future, the quantiles will be removed and replaced with = standard > deviation, true and weighted - the quantiles algorithm isn't super = accurate, we > can give more accurate numbers with standard deviation. Quantiles are much humane, standard deviation is scared=E2=80=A6 Just = FYI LOL. Thanks. Coly Li