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 ACAE93806DA for ; Fri, 23 Jan 2026 10:09:22 +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=1769162968; cv=none; b=bvjoKGUtdUSvLIHxDUj6it+BxCl58ZV91AZaoZBS9DGw5a198qsJ86WVSb1bO+kraVpsf3tAjGBDeI7bnZokt7OXwFIN8L2R/8HbYQGFTzeLo1QI5swsKaIHCjfAG6KOXe0ChdBMn5Knfue9Rolobywku2CJE9xyzKYbrxKgMdo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162968; c=relaxed/simple; bh=B425MfFhZpeKQKol8oR2Lp9W033EycczcOvhLPRwapc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KpciboKkVaPfU3TG0OTcki4vIhR8iC/Knbh84Yv1vdhAzfVKjn8Ed1aqXY0g59WNZ8qw0YQoRAzqvD3G4aUfr7e+GBOLtykXg2gnQrDrNvEARMApglAUR3chWYPY5aikJPXRuHWhRQpHrPcb1o90femP3bXemZaM0iPbp7CYS0I= 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=JzrCEQQa; 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=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="JzrCEQQa" 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=GC7dPX5dSGsXBgazAA0dMxchY39NWFnuSsEcrM4Y6Vo=; b=JzrCEQQaNag13yi+kuVTZPD6CB +lzNZFlaMNrCWhUF1G45t/sCCL0d4SZBjdSShBBfGfN4j6TgkSt0A9W44VreqKqKHvfdiK4BtkKWK b7/ywkiFf41tTP2lnTeAonE3HDVyDfZnhFZQljm6qB47RnrtVHGv0m59i7u1/mpCL3EFUCsraTvKf JC1X1N+LFK4xUKA2G20kX+saomjxSp2AfP+IYvsSepTqyIhzPgJwFdef9RkuMrkhwF2G4IEwG5qKX jLcoBuHto9NVacKlDiXS/DE3EbjAjm9XlWU1mXfxuqZ+pBWhpF0Y5mjx9iFBfdy8hTZ4zdW4T7kkF 28hLn74w==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjE6O-00000001cA1-0sWj; Fri, 23 Jan 2026 10:09:16 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id BDCE03007E1; Fri, 23 Jan 2026 11:09:15 +0100 (CET) Date: Fri, 23 Jan 2026 11:09:15 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Ryan Roberts , Mel Gorman , Ingo Molnar , Madadi Vineeth Reddy , Juri Lelli , Dietmar Eggemann , Valentin Schneider , Chris Mason , linux-kernel@vger.kernel.org, Christian.Loehle@arm.com Subject: Re: [PATCH] sched/fair: Disable scheduler feature NEXT_BUDDY Message-ID: <20260123100915.GL171111@noisy.programming.kicks-ass.net> References: <22a6976c-357f-40f7-b47f-2654545fc57d@arm.com> <20260123095305.GH171111@noisy.programming.kicks-ass.net> 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 Fri, Jan 23, 2026 at 11:04:20AM +0100, Vincent Guittot wrote: > On Fri, 23 Jan 2026 at 10:53, Peter Zijlstra wrote: > > > > On Thu, Jan 22, 2026 at 06:34:28PM +0100, Vincent Guittot wrote: > > > > > The new NEXT_BUDDY implementation is doing more than setting a buddy; > > > it also breaks the run to parity mechanism by always setting next > > > buddy during wakeup_preempt_fair() even if there is no relation > > > between the 2 tasks and PICK_BUDDY bypasses protections > > > > > > In addition to disable NEXT_BUDDY, i suggest to also revert the force > > > preemption section below which also breaks run_to_parity by doing an > > > assumption whereas WF_SYNC is normally there for such purpose > > > > > > -- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -8822,16 +8822,6 @@ static void wakeup_preempt_fair(struct rq *rq, > > > struct task_struct *p, int wake_f > > > if ((wake_flags & WF_FORK) || pse->sched_delayed) > > > return; > > > > > > - /* > > > - * If @p potentially is completing work required by current then > > > - * consider preemption. > > > - * > > > - * Reschedule if waker is no longer eligible. */ > > > - if (in_task() && !entity_eligible(cfs_rq, se)) { > > > - preempt_action = PREEMPT_WAKEUP_RESCHED; > > > - goto preempt; > > > - } > > > - > > > /* Prefer picking wakee soon if appropriate. */ > > > if (sched_feat(NEXT_BUDDY) && > > > set_preempt_buddy(cfs_rq, wake_flags, pse, se)) { > > > > > > This largely increases the number of resched and preemption because a > > > task becomes quickly "ineligible": We update our internal vruntime > > > periodically and before the task exhausted its slice. > > > > Hmm, fair enough. Do I munge that into Mel's patch, or should I create a > > second patch from you for this? > > I can prepare a patch with description and sent it right now if you want Sure that works. Then I'll stick both into tip/sched/urgent or thereabout :-)