From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7382E387373; Sat, 17 Oct 2026 16:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792254992; cv=none; b=A3C7iWmYhPvEBWwla+Y9yMNTYbWDPMH5kK7mAaeCgOR5WEmx+rrm5eKA1zXpP4uwiU1Nv+L1sKqfUg7NEWDjOZs3Rd9BZVrSgrzkgy/xCscwHHrWlh84E4OZMU8YWGj0JqroQIXBXTIBmxD9A+f1/mBRbVGvJN5aNruvzEv1upU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792254992; c=relaxed/simple; bh=lAM6BNzubqynxKXwIzI79UdGe1vKQxhMfdktT0muGJo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PMfrunDE3T9Z9TMETL3Kl2X2PG1blUbE8SzPV0UUBbDU9wSjUSEhjcmOtKmTMhj1VuKQAPBZCxcWSW/IOyWYriMYQHXL45aV04/vwoMpmGaEmr14IdPIIka3tOZ2T3kEjklkDTIcRlWl96etJeiAKIGtKFW3hTtaDggzz66k3dI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Yij8OWAs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Yij8OWAs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8D3C1F000C5; Sat, 17 Oct 2026 16:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792254991; bh=fxPuveJAVu9AJc1PyM+D/uXPZTaPHjZz/pEZXviutfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Yij8OWAskt16ByAHkRxViBXGYED0ru5B+1pbCzR09vifoMGa5C9kwy6NnvT130j/B BLstf4Nb3nTA5befMgq9EBjpG/bFfg0L+r1HmLcJxdVVbfytR1R8RbIU6iU6sWrPeF TpKMtqPw0zXuD1A3FqdI5t6K0e6SQmvi8jGZCqQo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Usama Arif , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 6.12 629/869] blk-iolatency: clear delay state when freeing policy data Date: Sat, 17 Oct 2026 17:57:50 +0200 Message-ID: <20261017160053.155718411@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Usama Arif [ Upstream commit 8935bf22c0a0db517a7f72f7097300e05dd852f5 ] io.latency can throttle a group which has no latency target of its own. When a sibling misses its target, check_scale_change() scales down its peers, and a peer that reaches queue depth one gets blkcg_use_delay() called on it on every further scale-down, even with min_lat_nsec == 0. iolatency_pd_offline() resets the target through iolatency_set_min_lat_nsec(), which clears the delay only on a nonzero to zero transition, so it never clears such a peer. Freeing the policy data then leaves blkg->use_delay set and blkcg->congestion_count elevated with nothing left that can drop it. blk_cgroup_congested() then returns true for every task in that cgroup and its descendants for as long as the cgroup lives: page_cache_sync_ra() cuts readahead to a single page, page_cache_async_ra() skips it altogether, and __folio_throttle_swaprate() takes swap_avail_lock and schedules a throttle on anonymous folio allocation. Clear the delay in iolatency_pd_free(). By then bio-held blkg references have drained, or the queue is frozen for policy deactivation, so check_scale_change() cannot re-arm it. The free callback can also see policy data which was never attached to a blkg, hence the pd->blkg check. Fixes: d70675121546 ("block: introduce blk-iolatency io controller") Signed-off-by: Usama Arif Acked-by: Tejun Heo Link: https://patch.msgid.link/20260814165712.510132-2-usama.arif@linux.dev Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-iolatency.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 49141c7fbcaa2..6be1c5e020ac9 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -1043,6 +1043,15 @@ static void iolat_release(struct rcu_head *rcu) static void iolatency_pd_free(struct blkg_policy_data *pd) { + struct blkcg_gq *blkg = pd_to_blkg(pd); + + /* + * Groups throttled as collateral have min_lat_nsec == 0, so + * iolatency_pd_offline() leaves their delay set. Drop it here, where + * no in-flight bio can re-arm it via check_scale_change(). + */ + if (blkg) + blkcg_clear_delay(blkg); call_rcu(&pd->rcu_head, iolat_release); } -- 2.53.0