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=1796385219; b=JirVoLen4eqZvw98Sr6UvZrTsuDTxqmpA9D1sC5Nywaa1Rfd8F9b7EBRRXcvDEI767Dk LlwzkYAQky1TT27qg66jrUH7DJAeDzlRKTD4AA0BVRVDLrMGgXm6IylBX5okHrDXsv+Ko xt2eac3h6Pbbi9RvbckLr3tBciY96YusZySSH3X16lK+8F/p90KVJ9vQmxwQOxrHly1GT AljqBJE+vmOcuBtTLreNFIQJydVmnYNeN9kME0j+fb9PYTlZcCL2f4KM7m9UguYWT1qJJ DIOUaduYtMvTLz73/Q2L19Sh2LYvbynUsBep3P5LDdSAVRWt6jIeYLj2/mg+N1fd7Eg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385219; 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=Uvd/HaGX7szxk0H/z0+1Jm4m/ycvrHUpr2a2JR4t7nU=; b=5p/yTqeFFz15gNm4no0nPQDPbmSmmiia3wgvO6ANdQCfJkVmsicHNd/7ZBXhhIK8WSdg JRPtWzpavDWRRD63bPX1Spl9lMafgCFeyhfLwK+Oow1KssBMbgyKuXz2pX5lvZtdZwqfF FW0bczwrDgzRVK+sdZdHzL2SuxpaarhEvulNpp4wu8nCAy3aPZz1iWj6mjCRHe2++Z6q3 rdrQDOZa+oT8YXEHpX5dUBTAnONo62/FAvjp/RpEKTgbo3v9iETS1eApNldvfYkb8N+wg cSY2DCLYoJo29i6RT6ERBRn8mPR2JMXwCUKLZbAFbFdVLhkdGfRuh/nqkR8rDM2zWEg== 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=WKLY6H2d; 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 BCF5D606A322; Fri, 4 Dec 2026 11:53:39 +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=WKLY6H2d Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34EF01F000C2; Fri, 4 Dec 2026 11:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385219; bh=Uvd/HaGX7szxk0H/z0+1Jm4m/ycvrHUpr2a2JR4t7nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WKLY6H2dNIhIQEzBNF6SnpFcyolUNby/ehKAfSxFdulOIG8EzlvnTdEzqhCt4rL/8 6XqJQhsOFvwGWcfVoYj95LxNxqw4CoOXWibUo4ADO47WEvWbu9AY4X+8grSvGgUas8 uHFNqHhw91ZpIQbCqQuycuQf6UwwyCZz5NJ66RQo= 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.6 0469/1167] blk-throttle: make blkio.reset_stats reset I/O counts Date: Fri, 4 Dec 2026 18:58:16 +0900 Message-ID: <20261204100714.234768436@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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: Context lines around the new throtl_pd_reset_stats() hunk were adjusted, since throtl_pd_offline() sits elsewhere in this tree, and the duplicated functions from the conflict were dropped. ] 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 aee16769b3348..8b7d6d9883d2d 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1724,6 +1724,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, @@ -1733,6 +1741,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