From mboxrd@z Thu Jan 1 00:00:00 1970 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 F1C673C140F; Thu, 2 Jul 2026 07:47:06 +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=1782978428; cv=none; b=UaWCWw/rz79pcvGSlXcrl6VYeYe+xHW9fdKqVrzhmKI2JgeXd5Bo7DOqrr37kF4/V3c0wUXvSj6t/RJohhvg9dsaEXhn9SQFxFSvhO3JEQr1YWe8XwsKPkKYkHqEZjw+CUBJApSRgDAFHJP5dyw3AnRo4bZXiT/mGOF5YX/e29s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782978428; c=relaxed/simple; bh=f58qN8+cPWpdyRabuqeU2YT5cmwk4MctFOJmEOKDQH8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=nS4eEZ8dLVqcgGU04vA/kkhbYBJbpvu+u/NeePJgS8kI4iTzMfp66RlyOiIW0ZaxHlw55tuw0IrjlSPlkHS3fjRYrqcctLqFrJ9RlEqBKQpQHQ4JUwAqubDjROM5zYHrOI+7HpYR0EpNm2FspcIsBnXVpsbJzIqAkIgxgnpfw5o= 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=RimxKwWb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=M4Kbz1qU; 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="RimxKwWb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="M4Kbz1qU" Date: Thu, 02 Jul 2026 07:47:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1782978425; 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=KywA4Lfysi04GQAQ20P/o9sToxE0GMadeohtBXoWTEE=; b=RimxKwWb5f2sQtXCuzHfWYH3jl4U0ReiF2qYDirRkSDkueLOUP4ZEzqNkiAiVu6Adbb/wS BLWwCWNsKzTvrz/NXjPkoMraKqpiGg9FnJEXI0jq60Z8VA00T6NOhhFmX5LIFIP/KgURir dujvrSSsTDbiFPqeBGb+F3T/8lG68kaRUPzXj5119C2Q2BLM6HH9RL03+VI2Yohl4Usq0P Obot3KeAg/u6oDewnaMcZaPMQbS8MdLjNTvIMBleG2mleJcT16KxnVDiCf96R2oSzC0wdl /8gfTQ5gY4BwCoMpr41yUGDa/a71i1AGGpkYGSwqWqgcELgQrTE293q6a7gp1A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1782978425; 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=KywA4Lfysi04GQAQ20P/o9sToxE0GMadeohtBXoWTEE=; b=M4Kbz1qUNnopSqTHnSSWlXASm8cArc3zzdjAuNAUhb/FAoOPKGkqFir5FqWA8r+OkYrIu4 SZ7tP5tRBv/eZxCw== 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/core] sched/eevdf: Delayed dequeue task can't preempt Cc: K Prateek Nayak , Vincent Guittot , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260701164920.1571352-1-vincent.guittot@linaro.org> References: <20260701164920.1571352-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: <178297842285.3843924.3625264237833981479.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: 04998aa54848f15332202d0bea008d2ca1ed1713 Gitweb: https://git.kernel.org/tip/04998aa54848f15332202d0bea008d2ca1e= d1713 Author: Vincent Guittot AuthorDate: Wed, 01 Jul 2026 18:49:20 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 02 Jul 2026 09:43:17 +02:00 sched/eevdf: Delayed dequeue task can't preempt Load balancing can migrate delayed dequeue tasks to even the load between CPUs. sched_balance_rq() -> detach_task() -> deactivate_task(DEQUEUE_NOCLOCK) -> set_task_cpu(dst_cpu) -> attach_task() -> activate_task(ENQUEUE_NOCLOCK) -> wakeup_preempt() A delayed task with shorter slice can be dequeued during pick_next_entity() but then jump to preempt because eligible. Always jump to update for delayed dequeue task even with shorter slice. Fixes: ba0d3bf5f97b ("sched/eevdf: Cancel slice protection if short slice tas= k is eligible") Reported-by: K Prateek Nayak Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak Link: https://patch.msgid.link/20260701164920.1571352-1-vincent.guittot@linar= o.org --- kernel/sched/fair.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fc6cd55..df8c9c2 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9949,6 +9949,13 @@ static void wakeup_preempt_fair(struct rq *rq, struct = task_struct *p, int wake_f goto update; =20 /* + * Do not preempt for tasks that are sched_delayed as it would violate + * EEVDF to forcibly queue an ineligible task. + */ + if (pse->sched_delayed) + goto update; + + /* * If @p has a shorter slice than current and @p is eligible, override * current's slice protection in order to allow preemption. */ @@ -9959,11 +9966,9 @@ static void wakeup_preempt_fair(struct rq *rq, struct = task_struct *p, int wake_f =20 /* * Ignore wakee preemption on WF_FORK as it is less likely that - * there is shared data as exec often follow fork. Do not - * preempt for tasks that are sched_delayed as it would violate - * EEVDF to forcibly queue an ineligible task. + * there is shared data as exec often follow fork. */ - if ((wake_flags & WF_FORK) || pse->sched_delayed) + if (wake_flags & WF_FORK) goto update; =20 /* Prefer picking wakee soon if appropriate. */