From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BA9D51891AB for ; Sat, 8 Nov 2025 13:12:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762607544; cv=none; b=Frfk8TwB0X1OwZfQgUFl7aU+E6rw16TX66OSoIR4PeQu4NYFuxDCPEwvnJ1T3Dso0uzSj5ap7LzRMqHqd3Om1hnpNGilqRw8mdqfgA7ZnDKVe+MsBGn8/cNkWMU5/BfnGzgKfDggOYfT3S8xrsIKR4YUcgQRmIh/WFRu8XXWfwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762607544; c=relaxed/simple; bh=PXJiQY4ILAQ5DLy4e0aKa19QrLr+vIBtDAgOMtJG6Wk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=nOCSe0uhWaNtyp89oB0M2z5nMr7XBLWElt8+SIVXlfFBWhHKpUT/zB6ork16OV++kRZHrzqBVIuTasL3Ihp6pK55rrOFIhpQKCD0cYuhI+pO9lz7jmQBmGFOoEw2qnbgIYm49EoR6cjMz7nvv+J21i7gcm5CTMTIqWZMjwR8Bjk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TpGI1R2q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TpGI1R2q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE35CC116C6; Sat, 8 Nov 2025 13:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762607544; bh=PXJiQY4ILAQ5DLy4e0aKa19QrLr+vIBtDAgOMtJG6Wk=; h=Date:From:To:Cc:Subject:From; b=TpGI1R2qeiH5rzzNGRp/ga0OQkyG6VsdtfuLJYeBGoVB6Sutt6iICFyZ7F+ntHMqj glUYRIbRRGU3x0c0pZiBFmbcSs5WJZtMbfA23TmW4wLzm/uUAQoYCEIYFRaVUPGgtM JQPTFEcRtUGfg5uI/Orkgpx0XmgOTPPUpa+yt4h9RD/UqnZfrfkF9lqWAZA61ySAXI e1WfzaOJE5b+/HT1mubxAP678X0VVHuhuuj8DhsdjxPx2CINr3eiuldP7GZ321m8cb jvEKUrEXUQexIVlCy4r7V6dZciB93Zr6dbroCXb89u6qEcUCvzHX6kzXHq7o30DqbN HHs6J8q24OPWg== Date: Sat, 8 Nov 2025 14:12:17 +0100 From: Ingo Molnar To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Thomas Gleixner , Andrew Morton , Mathieu Desnoyers Subject: [GIT PULL] scheduler fix Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Linus, Please pull the latest sched/urgent Git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-2025-11-08 # HEAD: 956dfda6a70885f18c0f8236a461aa2bc4f556ad sched/fair: Prevent cfs_rq from being unthrottled with zero runtime_remaining Fix a group-throttling bug in the fair scheduler. Thanks, Ingo ------------------> Aaron Lu (1): sched/fair: Prevent cfs_rq from being unthrottled with zero runtime_remaining kernel/sched/core.c | 2 +- kernel/sched/fair.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f1ebf67b48e2..f754a60de848 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9606,7 +9606,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, guard(rq_lock_irq)(rq); cfs_rq->runtime_enabled = runtime_enabled; - cfs_rq->runtime_remaining = 0; + cfs_rq->runtime_remaining = 1; if (cfs_rq->throttled) unthrottle_cfs_rq(cfs_rq); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 25970dbbb279..5b752324270b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6024,20 +6024,17 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)]; /* - * It's possible we are called with !runtime_remaining due to things - * like user changed quota setting(see tg_set_cfs_bandwidth()) or async - * unthrottled us with a positive runtime_remaining but other still - * running entities consumed those runtime before we reached here. + * It's possible we are called with runtime_remaining < 0 due to things + * like async unthrottled us with a positive runtime_remaining but other + * still running entities consumed those runtime before we reached here. * - * Anyway, we can't unthrottle this cfs_rq without any runtime remaining - * because any enqueue in tg_unthrottle_up() will immediately trigger a - * throttle, which is not supposed to happen on unthrottle path. + * We can't unthrottle this cfs_rq without any runtime remaining because + * any enqueue in tg_unthrottle_up() will immediately trigger a throttle, + * which is not supposed to happen on unthrottle path. */ if (cfs_rq->runtime_enabled && cfs_rq->runtime_remaining <= 0) return; - se = cfs_rq->tg->se[cpu_of(rq)]; - cfs_rq->throttled = 0; update_rq_clock(rq);