From nobody Sun Feb 8 13:32:28 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 5142933A010; Wed, 21 Jan 2026 16:51:18 +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=1769014280; cv=none; b=ixG1sRbKCNYSdN/XHWozDh7Sn/ojKYLBkyPYzt1+Wh/8XDpmbZ57nSM5hwvZaDNSTde5dQqfjT6KZ+vG7CrtQcwWHx/25g42z1CQ0RXTposDwEZnhnySWs/2bL0G0nGO9BztlTOCbjdCGSnu01qyggHFWdQR5236C6T2A3NYvFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769014280; c=relaxed/simple; bh=P0AtXjIoXynm2jcf+R9g9RE30v3GNM7AMrhWwoOPQDc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=ScaUkkH28z/VudHBro45LdXCv26dItWirp0/6mtYo+VxOWJryxJS2gYYc0ur4Y4vgPPpl84FabBAimSPEAAJyHvfk+U0jh1dyAvkToFKtUZMZADg/fbMR3S44ChZGAr1JCWFuoXcZblFcmw51HMJ34ae04zema99GDvBPpRB4fU= 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=3rG/w9re; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9dttibsN; 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="3rG/w9re"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9dttibsN" Date: Wed, 21 Jan 2026 16:51:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1769014276; 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=xnsmtyC7pTLEKim1YREEvXMRR7kxKH0s8i/TLB0acsM=; b=3rG/w9rerqZ3cYEcmh9TZ41h1L/EkpQOAzCyEzUTvGWNziJAXtwAIzYaGcmKWpc3HsRh4V UEhrvTvXmcpVdq4phW1sNc2M7qWL/JQuz5ofA4iT9U7bpz0swxWsswjP/dMKBy40esItnW DjOkslfkAXzsdi7CKDpMb3AW2IBsgJ7W0maw9w0Cm+C3BIIvpHKGw+weV4LOd8Hm7zFGPy /vH8btvLBGotx2zU3BzigRN9d8zwG4Dzp+KnyRujfmTOlYP6INM3QHvo2SRNpphZGeGIUw BjRps54c3KNfeGgJ+SDYXjITyt8A0zz6pa2KCUeUrT1t4nkw6qwdI3y7Dc+TzQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1769014276; 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=xnsmtyC7pTLEKim1YREEvXMRR7kxKH0s8i/TLB0acsM=; b=9dttibsNK0uB3VKOvLkkYGMS79gdrAuPyzkxFM96bYXeyQnix1/VpSYh4lPLeG1OEcbV9G u/eDo11J2F55xsCQ== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/fair: Fix pelt clock sync when entering idle Cc: Samuel Wu , Alex Hoh , Vincent Guittot , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260121163317.505635-1-vincent.guittot@linaro.org> References: <20260121163317.505635-1-vincent.guittot@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <176901427445.510.16153450380853197689.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/urgent branch of tip: Commit-ID: 98c88dc8a1ace642d9021b103b28cba7b51e3abc Gitweb: https://git.kernel.org/tip/98c88dc8a1ace642d9021b103b28cba7b= 51e3abc Author: Vincent Guittot AuthorDate: Wed, 21 Jan 2026 17:33:17 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 21 Jan 2026 17:46:08 +01:00 sched/fair: Fix pelt clock sync when entering idle Samuel and Alex reported regressions of the util_avg of RT rq with commit 17e3e88ed0b6 ("sched/fair: Fix pelt lost idle time detection"). It happens that fair is updating and syncing the pelt clock with task one when pick_next_task_fair() fails to pick a task but before the prev scheduling class got a chance to update its pelt signals. Move update_idle_rq_clock_pelt() in set_next_task_idle() which is called after prev class has been called. Fixes: 17e3e88ed0b6 ("sched/fair: Fix pelt lost idle time detection") Closes: https://lore.kernel.org/all/CAG2KctpO6VKS6GN4QWDji0t92_gNBJ7HjjXrE+= 6H+RwRXt=3DiLg@mail.gmail.com/ Closes: https://lore.kernel.org/all/8cf19bf0e0054dcfed70e9935029201694f1bb5= a.camel@mediatek.com/ Reported-by: Samuel Wu Reported-by: Alex Hoh Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Tested-by: Samuel Wu Tested-by: Alex Hoh Link: https://patch.msgid.link/20260121163317.505635-1-vincent.guittot@lina= ro.org --- kernel/sched/fair.c | 6 ------ kernel/sched/idle.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e713022..a148c61 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8995,12 +8995,6 @@ idle: goto again; } =20 - /* - * rq is about to be idle, check if we need to update the - * lost_idle_time of clock_pelt - */ - update_idle_rq_clock_pelt(rq); - return NULL; } =20 diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index c174afe..abf8f15 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -468,6 +468,12 @@ static void set_next_task_idle(struct rq *rq, struct t= ask_struct *next, bool fir scx_update_idle(rq, true, true); schedstat_inc(rq->sched_goidle); next->se.exec_start =3D rq_clock_task(rq); + + /* + * rq is about to be idle, check if we need to update the + * lost_idle_time of clock_pelt + */ + update_idle_rq_clock_pelt(rq); } =20 struct task_struct *pick_task_idle(struct rq *rq, struct rq_flags *rf)