From mboxrd@z Thu Jan 1 00:00:00 1970 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 4A21630E84F for ; Tue, 16 Jun 2026 08:52:18 +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=1781599940; cv=none; b=XVWoEJQZe2BsI3DHlcDQISkxpS2P8IcDOMi1ekvfNSWuruakVwGSIufQiZAEQEZuZ5RsKPyueX7ku7Ce+PgaypoCJx0gOELeFoKViRt9tVovaTQAwkPCmCT94K74Xp+A9uTingBzdSgLgLmb7J/3SF76FOUehXcV9xylQb2zgl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781599940; c=relaxed/simple; bh=9EM515GymH20QkF0NAbKHr2l0gnH36gI6eqL5+dqCIo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VUIgundAbBG/vsbY00c9GlfE+V2ZFkOH99UrUhLQibRzGY19DXb5b+wq0L8VGSkDZMj2sGT9b35eAqrusryr7N7gVMDIQo81V7el3Er+lQzzrOo+MS2y0hR+MoxK8v3fLnIuZ24qOQgsGpoTvzueWSkWZ6vxvLbgh6b7SGsyVEU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=bV1W1z56; 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=pass 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="bV1W1z56" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ueBrbDp7FMam/4QwVK8XgEA78w3OyhGkwyDQojxtaSw=; b=bV1W1z566UIh/bDUrPsaqDWYWi OYDMqzaRTiDjtnhY9vG0NU7lkx7txik1rsPSHVNnZuINI8yFqVN2uc4tTpcYyd2i2qrgR0fA/wkpV +/wDGXFYVZx1ebNRZjRNj8VoXOLYrfl7XWMXhL+SvsvK8MkT1/1sCdfBJNjBMrs2thnVrICvINv0u mB8WCFFa/FB7IGFmxYacKqHFrbqEDjfM0xN+uZfuFTUpKnM8yuM/GWRBaIFzUTYJ2KUn8Onme64kz ldYA3M5pkc/UIOXhGBkkHIBR9+/omYWmNLsUj7fiwsBUArBw7yEXTVoNM5NvY5FtgCMs/Q9gPi6GX axL54ALw==; 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.99.2 #2 (Red Hat Linux)) id 1wZPWW-0000000AdPY-1A0d; Tue, 16 Jun 2026 08:51:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 4D7F530031E; Tue, 16 Jun 2026 10:51:54 +0200 (CEST) Date: Tue, 16 Jun 2026 10:51:54 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, linux-kernel@vger.kernel.org, qyousef@layalina.io Subject: Re: [PATCH 1/6 v2] sched/fair: Set next buddy for preempt short Message-ID: <20260616085154.GG42921@noisy.programming.kicks-ass.net> References: <20260615162420.420957-1-vincent.guittot@linaro.org> <20260615162420.420957-2-vincent.guittot@linaro.org> 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 In-Reply-To: <20260615162420.420957-2-vincent.guittot@linaro.org> On Mon, Jun 15, 2026 at 06:24:15PM +0200, Vincent Guittot wrote: > If a shorter slice task can preempt current at wakeup, we make sure that > the decision will not be overwritten in between by setting the task as the > next buddy. This still implies that the waking task remains eligible when > the scheduler will actually pick the next task to run. > > Signed-off-by: Vincent Guittot > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index d78467ec6ee1..83bce5a04f3d 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9903,7 +9903,7 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f > preempt: > if (preempt_action == PREEMPT_WAKEUP_SHORT) { > cancel_protect_slice(se); > - clear_buddies(cfs_rq, se); > + set_next_buddy(&p->se); > } Should this not be something along the lines of set_preempt_buddy()?