From nobody Thu Apr 2 20:26:36 2026 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4E7CF2222B2 for ; Thu, 19 Feb 2026 08:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771488660; cv=none; b=ecY0LM44PsALE9cad1JY13BA1JaiB9A91/4seuELzhd6sGiHbCPrNN2zjfrRL3JTFiXBBZ0gUk0mRPJss35TFZoJKxzjtbVM9TUan4wmt5GQVNAOKO+vi7mFOxm0EgFIz97CHjGKK1H9r7EM1zt5Dh83eAoJA2GyE49EUj8Rzyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771488660; c=relaxed/simple; bh=+X8QytkFwvjonO55mLhVGD/6EK8ONNO7Mee3Q4HG+hQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=XAfDQKdwnEHszp/8JzX0eRnP/wCOYlnu9vgOhr3zfwiGoeewfhRVFQdnZINbbfD2j0Ynj3gHEA0FPG7y2D2Frqr57N7NPXZrGjZkV0FzeF5buSN7x/u9xOozHnLf76kgamQTWQud1PQbEjU/WHIQS3Yl9onk17zScBH7wSJyDW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BnLc2ALj; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BnLc2ALj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=wgvmMbGZTcc14/fwbMa0Vsxs68JQMpfuCOmPLN/La0c=; b=BnLc2ALjSEQEWWegpxekVKMuYh yatltwYdOM116lKj3D5HG9VkY8bMbcrxd7blJFRfpcY/LjUOGSOuJt9juVY5thCdQu85NmIq0wZdU /IJ2xqma1hXafDb9Ci0BCthRzIuqqvoxclUj/g754S098J1Ce5FgmIkjmXfFfRG6D04MIgv4X56kw PvS74RU0PnLbbnKm+Is4wd6EdmqDiKs1XyeKAFtrj7lG3XZxOswwDg/j4mjSX4yrTQBO+u1JfkYhB fDKuQVQwmNAZ0shQ3wFTBDMvunrwFpqZ6NrQaqgJiLnSLVWbtvKYihFZQFtYDfxx83Co8ekD5aH+0 LgvbfUFg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vsz7Z-00000000xzY-26Kv; Thu, 19 Feb 2026 08:10:49 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id BEB6C303324; Thu, 19 Feb 2026 09:10:48 +0100 (CET) Message-ID: <20260219080624.561421378@infradead.org> User-Agent: quilt/0.68 Date: Thu, 19 Feb 2026 08:58:42 +0100 From: Peter Zijlstra To: mingo@kernel.org Cc: peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, wangtao554@huawei.com, quzicheng@huawei.com, kprateek.nayak@amd.com, dsmythies@telus.net, shubhang@os.amperecomputing.com Subject: [PATCH v2 2/7] sched/fair: Only set slice protection at pick time References: <20260219075840.162631716@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We should not (re)set slice protection in the sched_change pattern which calls put_prev_task() / set_next_task(). Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption") Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Tested-by: K Prateek Nayak Tested-by: Shubhang Kaushik --- kernel/sched/fair.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5444,7 +5444,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, st } =20 static void -set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) +set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, bool first) { clear_buddies(cfs_rq, se); =20 @@ -5459,7 +5459,8 @@ set_next_entity(struct cfs_rq *cfs_rq, s __dequeue_entity(cfs_rq, se); update_load_avg(cfs_rq, se, UPDATE_TG); =20 - set_protect_slice(cfs_rq, se); + if (first) + set_protect_slice(cfs_rq, se); } =20 update_stats_curr_start(cfs_rq, se); @@ -8977,13 +8978,13 @@ pick_next_task_fair(struct rq *rq, struc pse =3D parent_entity(pse); } if (se_depth >=3D pse_depth) { - set_next_entity(cfs_rq_of(se), se); + set_next_entity(cfs_rq_of(se), se, true); se =3D parent_entity(se); } } =20 put_prev_entity(cfs_rq, pse); - set_next_entity(cfs_rq, se); + set_next_entity(cfs_rq, se, true); =20 __set_next_task_fair(rq, p, true); } @@ -13597,7 +13598,7 @@ static void set_next_task_fair(struct rq for_each_sched_entity(se) { struct cfs_rq *cfs_rq =3D cfs_rq_of(se); =20 - set_next_entity(cfs_rq, se); + set_next_entity(cfs_rq, se, first); /* ensure bandwidth has been allocated on our new cfs_rq */ account_cfs_rq_runtime(cfs_rq, 0); }