Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4722171rwl; Mon, 3 Apr 2023 08:44:52 -0700 (PDT) X-Google-Smtp-Source: AKy350aVYu8REri4SSwRx4LHshs5zs34WCwNEZqLl4MLO7xAioAFDgKfqkE0S2DdO+jcroudgsi/ X-Received: by 2002:a17:903:28c4:b0:1a2:8f43:5449 with SMTP id kv4-20020a17090328c400b001a28f435449mr13302351plb.54.1680536692035; Mon, 03 Apr 2023 08:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680536692; cv=none; d=google.com; s=arc-20160816; b=HmyhQwcucSv1baVswH+w8w/VRBBW9TPAJWX5qTNGAuYtHWmuGxMkoqu8EmqjoM/3Mm yueU01x1Fj4rmECVr7kY56+tFRb40X1Utda/QhSIwzjA5SGQDheIuwSm5WsL2JFgy3Fu 6Husx1Loxy7qqxjH5qF05uNp06Rzy7HUYyrep0wO/HBuq1dCyO+zgP8ZPJn2d+qEZcll BqOc6ZheTIWIfOfKTWDrVdZIMZQDvP/8LIxj+z6o3wka4rbO5pzyCHUrbCXIdgI6PKqa wYXlrIA4vz2s2A3im95jU0APoAsgDNi3Hht4YBcvEMLmPEV394TwMpftLfueRrkCcv9V HVwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YDwpYF4u/WbyyCSZ3xRLaLaKTiwTm4Y0OH0oxOZVABk=; b=GbTZ5mGWBK/aV7NLFElLWZtm8WOOg2L5yELJKsAvzY27qFbwG6Mpt1CUKfIhhq71Rq 8d9VX+itjNN9jOeniRBf1GfZW8EPWiFRnOOCqfISVbLzGEwuVieTtvk6rY9F21lmmy1w 1xz0th8KgrwdUztpqPq77ACksStCG00LXcO3aS6VOf+7oVtxwVLGYAyMXQJOYoygPExQ WXZCKaFoi+RsIKyyqq6lXUFty9Llrb02pp5PjY6SfqxQbtnA3j7lM/Png5uKv5Z6lsEe +oLPgP+rZDAwSHCpsvbqEBNhHhGQZGxglnfZGVXW2j+kmj2Z3sDf412MIScQtPiZIqFQ tQQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=l9MyysTe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a170902f68800b001968124dc22si8561765plg.560.2023.04.03.08.44.38; Mon, 03 Apr 2023 08:44:52 -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.com header.s=susede1 header.b=l9MyysTe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232853AbjDCPaa (ORCPT + 99 others); Mon, 3 Apr 2023 11:30:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbjDCPaZ (ORCPT ); Mon, 3 Apr 2023 11:30:25 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C27671BFD; Mon, 3 Apr 2023 08:30:24 -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 4100521E7E; Mon, 3 Apr 2023 15:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680535823; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YDwpYF4u/WbyyCSZ3xRLaLaKTiwTm4Y0OH0oxOZVABk=; b=l9MyysTeT5JhkZxjgLyTDnDn9swdOLi94eW+7mcQeIg2+njQJlaolClaSoA7hl0F7WrExj qJyGBmD+AmUjjrpfgx5KA4CUDB+4tJXxnQdZfYEARqoeezCLGSzAcI33I7rE4th2sVQErr bsCKR2DhASdb81S0vQ47j+J7mTEVT3c= 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 0A22C1331A; Mon, 3 Apr 2023 15:30:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0VkcAQ/xKmQHPgAAMHmgww (envelope-from ); Mon, 03 Apr 2023 15:30:23 +0000 Date: Mon, 3 Apr 2023 17:30:21 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Jinke Han Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] blk-throttle: Fix io statistics for cgroup v1 Message-ID: <20230403153021.z4smxxnxbgdcgcey@blackpad> References: <20230401094708.77631-1-hanjinke.666@bytedance.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zyxomnpk7u4ms5xp" Content-Disposition: inline In-Reply-To: <20230401094708.77631-1-hanjinke.666@bytedance.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 --zyxomnpk7u4ms5xp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 01, 2023 at 05:47:08PM +0800, Jinke Han wrote: > From: Jinke Han >=20 > After commit f382fb0bcef4 ("block: remove legacy IO schedulers"), > blkio.throttle.io_serviced and blkio.throttle.io_service_bytes become > the only stable io stats interface of cgroup v1, There is also blkio.bfq.{io_serviced,io_service_bytes} couple, so it's not the only. Or do you mean stable in terms of used IO scheduler? > and these statistics are done in the blk-throttle code. But the > current code only counts the bios that are actually throttled. When > the user does not add the throttle limit, =2E.. "or the limit doesn't kick in" > the io stats for cgroup v1 has nothing. > I fix it according to the statistical method of v2, and made it count > all ios accurately. s/all ios/all bios and split ios/=20 (IIUC you fix two things) > Fixes: a7b36ee6ba29 ("block: move blk-throtl fast path inline") Good catch. Does it also undo the performance gain from that commit? (Or rather, have you observed effect of your patch on v2-only performance?) > Signed-off-by: Jinke Han > --- > block/blk-cgroup.c | 6 ++++-- > block/blk-throttle.c | 6 ------ > block/blk-throttle.h | 9 +++++++++ > 3 files changed, 13 insertions(+), 8 deletions(-) The code looks correct. Thanks, Michal --zyxomnpk7u4ms5xp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCZCrxCQAKCRAkDQmsBEOq uYrdAQDQZdcEO4tDtRmV1dkrKTvOziHQuJI0oy2suFYm6RIM5QEAhZBPPLwgfokP zz+x15hzo4Ce/VUdKwWOjbjwsq0/9w0= =32so -----END PGP SIGNATURE----- --zyxomnpk7u4ms5xp--