From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388140; b=LKpKXITcHuOlrvdNwlIHDI8uP1ENm1xoupNvDfaJvepLmfAYpYoIfIbivBaT2adEAvHJ lvlCxskGJC/KYPbpp3qhCj1kq3yRP4lDDiLfOiYwfhlRbWMBl+XRPABHtl8nBcsIrUD7/ mgDsJUAteagQcwOlTm7jbHef5k798ud7v0EZ5oSQIFE3vKgUt6S53NrQVnWi2M20yQ6Dh reKgLNZLC39/o/3xqV8Lg3PIXDVs1pFcuD4iSA6sTvs1HcuFgaHxQV5zWTExz468d0eUS kPQ8C/bif9l/VQb6ckVxVSIcKeB516s1jRQ1mZy2o6izZ0nw+7P0uuIwu3BmYMDh02Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388140; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=s8NAhEnMBOoEb3VcYNJK23RH2Hx5vCmFODMvJC4ykk4=; b=RVnAkg8RSA98MpOWRBygZ+JqNJXodVwE7MBAV48ntu+h2HRzG5n6iyYhJ/LSjW5DHGWe QGqq5dMH8gwhryjf3pQq81zsUZPLjU5HcYQhU3zYa2fYQJoHG2lu1VPgvU6B9Ti+10iv1 7Tc2WQhP3Xo4AwPLQ7j6VoFHyI2rWhNEJlQ6GAPhDQeHsjxAdWWXQXwTJmrhEJuNo6jDO yNJcrivIVfiwvGsG5lGcS6t5keXYjSOGMCg/qlKzbEupDNTwxH6wJ6vIdIRH1lTFOZgB4 oMT7uLaWkJiJQlBdjpqE1PgH7w/0qHfyw8Qbbzr39h277TJ/hB9lctqoGIGW+3LLjUQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fHukwYKt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EF96606A322; Fri, 4 Dec 2026 12:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=fHukwYKt Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0A531F000C2; Fri, 4 Dec 2026 12:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388140; bh=s8NAhEnMBOoEb3VcYNJK23RH2Hx5vCmFODMvJC4ykk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fHukwYKt3gkI4jvKLM7TmBT/Y2Dmj5GPN51QGqtpV87PdWl5eQlqoTLXNstdfHjhg MqlSbqltC9pqFfaGUXRxFwSxY/0LmdqhEQLFum9icw4Q/15QrVEujXuTm0x+8yUPL8 jZpQDzdlIGVjdFwFX5JGPGTMGdc1/G/LGZk55cgg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tejun Heo , Josef Bacik , Jens Axboe , Sasha Levin Subject: [PATCH 6.1 0448/1059] blk-throttle: make blkio.reset_stats reset I/O counts Date: Fri, 4 Dec 2026 18:59:39 +0900 Message-ID: <20261204100655.902602778@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik [ Upstream commit ac81a07a0bd5e75e8edc0eb5be563be1b2d56554 ] blkio.throttle.io_service_bytes and io_serviced were reset by blkcg_reset_stats() while the counters were part of the blkg. Now that they live in the throtl_grp, add a pd_reset_stats_fn for them. Fixes: 7ca464383aec ("blk-throtl: stop using blkg->stat_bytes and ->stat_ios") Cc: Tejun Heo Signed-off-by: Josef Bacik Acked-by: Tejun Heo Link: https://patch.msgid.link/20261028164415.1262013-27-axboe@kernel.dk Signed-off-by: Jens Axboe [ sashal: Adjusted context because the surrounding functions are ordered differently, so the new reset-stats function and its ops hook land after a different neighbor. ] Signed-off-by: Sasha Levin --- block/blk-throttle.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 869c92ab87c59..0256a53258c4e 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1733,6 +1733,14 @@ static void throtl_shutdown_wq(struct request_queue *q) cancel_work_sync(&td->dispatch_work); } +static void throtl_pd_reset_stats(struct blkg_policy_data *pd) +{ + struct throtl_grp *tg = pd_to_tg(pd); + + blkg_rwstat_reset(&tg->stat_bytes); + blkg_rwstat_reset(&tg->stat_ios); +} + struct blkcg_policy blkcg_policy_throtl = { .dfl_cftypes = throtl_files, .legacy_cftypes = throtl_legacy_files, @@ -1742,6 +1750,7 @@ struct blkcg_policy blkcg_policy_throtl = { .pd_online_fn = throtl_pd_online, .pd_offline_fn = throtl_pd_offline, .pd_free_fn = throtl_pd_free, + .pd_reset_stats_fn = throtl_pd_reset_stats, }; void blk_throtl_cancel_bios(struct gendisk *disk) -- 2.53.0