From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 723D426E173 for ; Fri, 26 Jun 2026 06:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456888; cv=none; b=B3rImXBq74kBmA/PcEVWO6f0txJB+TI7RZieNVAvGyMXVh0tpFF+u6nRH3ZGNUKmuag8jVhIoha1hw/TUbqiiTHCYLDjJEo1qXTF2u6mh53hB6BSLkN1qyudQFcQxxsgNtDkZiNTv3LbLot+DPp+MxyvNYWwXq2qlX+2GzP56Fw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456888; c=relaxed/simple; bh=kbLRnOuL1hR9AalWCeHjBee+xmz6AQv1LPoLvejUhwA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=epkmcIhhEOBW6gkUvkXRiscYdhAoCYdDy+kX4kPRBUu4s6G0YsHCUKPENo2TDkczOWhvAzuTrq2v3Z07NUUl6NTJfboW/cBkkLxqaaLC8xQkXYYykIy5+QfbINXB+S+/R+f2MwWsrUstePKw7SAxZ/UGWzDSC4P+uA2q+FQQ+5o= 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=wOV70/mo; arc=none smtp.client-ip=90.155.50.34 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="wOV70/mo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=BVKxVFFEYj+LKDVL9OnrXgpR5m4renjaN3zfJ2DM7+Q=; b=wOV70/moh6InK1Obss+R+itnGu nHuUZQvMB+rfs0xjZYlcSBYD3S2eElX2+6/SJOT3dpNWOgcuIiFE+Yi2F6RJ0/SE8GCd1SykQ+5Fd icXyB8r7zoYhTSNa+aiDZ6AhgNuVFSg9KXfu8ux8DHAoE27bFX63nXm5wSIoWKzCQuf4slHIezBF1 azPfcP3cHxEJbnjPTr9C7CxHATGc2zEInr84Mung7kmvLZMwLLHeA7vxfLfmGmNFjicEtuyjndErk avSSBiL1sv1ZhcoGv5HOEdzmXhscu//1odGBhgvXSVy9lfBbZ13B2XgsaXh8b7LTxumbPr6u5b8Ka zOwWvdSQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd0SU-0000000BNLg-3Sln; Fri, 26 Jun 2026 06:54:39 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A6056300BDE; Fri, 26 Jun 2026 08:54:38 +0200 (CEST) Date: Fri, 26 Jun 2026 08:54:38 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: K Prateek Nayak , mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, qyousef@layalina.io Subject: Re: [PATCH 1/6 v3] sched/fair: Set next buddy for preempt short Message-ID: <20260626065438.GG1181229@noisy.programming.kicks-ass.net> References: <20260624151229.1710703-1-vincent.guittot@linaro.org> <20260624151229.1710703-2-vincent.guittot@linaro.org> <07c84814-bbca-4c94-aebb-5ac0858efcfc@amd.com> 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: On Thu, Jun 25, 2026 at 02:40:34PM +0200, Vincent Guittot wrote: > On Thu, 25 Jun 2026 at 08:24, K Prateek Nayak wrote: > > > > Hello Vincent, > > > > On 6/24/2026 8:42 PM, Vincent Guittot wrote: > > > 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); > > > } > > > > On a tangential note, I just noticed set_preempt_buddy() has two unused > > parameters. Seems to have been like that since it was introduced in > > commit e837456fdca8 ("sched/fair: Reimplement NEXT_BUDDY to align with > > EEVDF goals"). > > > > Perhaps this can be included in the series too as a cleanup: > > I would even go further and remove it. The NEXT_BUDDY feature is broken anyway Anyway, the reason I mentioned using it, is that it only sets next if the new entry has an earlier deadline. But I suppose you want to violate the strict deadline order, but in that case we should still order on slice length. We should not set next when we already have one that is a shorter slice, no?