From nobody Sun Jun 14 15:57:17 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 410043932D9; Fri, 3 Apr 2026 12:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775219415; cv=none; b=ZoC4wEflyFNjOAV2vnjhSHgEt2NeK1w4LebLRKqeA/yPfE5XedbxWr4s0BfI2N3fSqhvkI7xanbG5UfsqgvkRdGrK9k8+1oDkSCS1h5Y9Zb7uS7jFmUXECZCRlXEDAuRtzgMA8EWNaR5J5KLzzdA/30jLzPg87IDFwtJwrcz1zw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775219415; c=relaxed/simple; bh=M5YoWHrJBCQpAEPJ6Y/2gzi/4xgxRSXTh6Zm2VCqFqM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JP4za3zFc4JSTme3HSpwE4WqeTlYtrbq+gYHgCdKXs1Hi99MSG5TXAFOjoaVrr6WGAbDYoBZmlrjYpnPF2n0OaoVa9bGeyqx1jzMB8oP1kxFpXYTaJaVqWBcQUc5bzWiD3JY3wAGe1n+8YE+de8/uEqN4xphirXpKo/Y6KaqkFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=a/B0F163; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1kQ7nFLm; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="a/B0F163"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1kQ7nFLm" Date: Fri, 03 Apr 2026 12:30:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1775219412; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iVSDBb8ZoOxo3cTJfaRVK+7vbHDZmQrvNFdCmS5D5vo=; b=a/B0F16337PE2rfHtQ+3Xa3iVrElmqonaXisHRe0ov7qxu+i7kNpCUfbR3Eapfsztrfvv0 bzJUruopEp+pj4Islu8UKYkWH/j4AcKwvxD0urtKHtK6+T7/A3zhk7Ln2OuzCn3UqVD20y C6w3l1oObmUCO4C1DZrrdcKbh3I8eQmZjTe4nIwv2j8jpPWFm4IUE2nv9B8xoG/XQCtqtG 5hmH7BMRSHzYybT9QVfU06vIh4285miiI75S90pVmDMe/rYqAwmYAKvfwoss8tD5FCgurn Z8wFJcZ7RM0GYv9T0H0XRFz8RaGP/0l8lolLAWoVpgVnamQmr1sRv/TeRGrcAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1775219412; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iVSDBb8ZoOxo3cTJfaRVK+7vbHDZmQrvNFdCmS5D5vo=; b=1kQ7nFLmZlkNuck92Q4yRFEqZUwA3pJJ7C6c8tiCZsTXQe0DUbbyPY5LlkFBMSjvAKv1dE dO/HRRHTNbW5KfCw== From: "tip-bot2 for John Stultz" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Add assert_balance_callbacks_empty helper Cc: Peter Zijlstra , John Stultz , K Prateek Nayak , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260324191337.1841376-8-jstultz@google.com> References: <20260324191337.1841376-8-jstultz@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177521941135.1647592.10540495257034151170.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: f9530b3183358bbf945f7c20d4a6e2048061ec50 Gitweb: https://git.kernel.org/tip/f9530b3183358bbf945f7c20d4a6e2048= 061ec50 Author: John Stultz AuthorDate: Tue, 24 Mar 2026 19:13:22=20 Committer: Peter Zijlstra CommitterDate: Fri, 03 Apr 2026 14:23:40 +02:00 sched: Add assert_balance_callbacks_empty helper With proxy-exec utilizing pick-again logic, we can end up having balance callbacks set by the preivous pick_next_task() call left on the list. So pull the warning out into a helper function, and make sure we check it when we pick again. Suggested-by: Peter Zijlstra Signed-off-by: John Stultz Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: K Prateek Nayak Link: https://patch.msgid.link/20260324191337.1841376-8-jstultz@google.com --- kernel/sched/core.c | 1 + kernel/sched/sched.h | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c997d51..acb5894 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6853,6 +6853,7 @@ static void __sched notrace __schedule(int sched_mode) } =20 pick_again: + assert_balance_callbacks_empty(rq); next =3D pick_next_task(rq, rq->donor, &rf); rq->next_class =3D next->sched_class; if (sched_proxy_exec()) { diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b863bbd..a2629d0 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1857,6 +1857,13 @@ static inline void scx_rq_clock_update(struct rq *rq= , u64 clock) {} static inline void scx_rq_clock_invalidate(struct rq *rq) {} #endif /* !CONFIG_SCHED_CLASS_EXT */ =20 +static inline void assert_balance_callbacks_empty(struct rq *rq) +{ + WARN_ON_ONCE(IS_ENABLED(CONFIG_PROVE_LOCKING) && + rq->balance_callback && + rq->balance_callback !=3D &balance_push_callback); +} + /* * Lockdep annotation that avoids accidental unlocks; it's like a * sticky/continuous lockdep_assert_held(). @@ -1873,7 +1880,7 @@ static inline void rq_pin_lock(struct rq *rq, struct = rq_flags *rf) =20 rq->clock_update_flags &=3D (RQCF_REQ_SKIP|RQCF_ACT_SKIP); rf->clock_update_flags =3D 0; - WARN_ON_ONCE(rq->balance_callback && rq->balance_callback !=3D &balance_p= ush_callback); + assert_balance_callbacks_empty(rq); } =20 static inline void rq_unpin_lock(struct rq *rq, struct rq_flags *rf)