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 5EB7D35CBCD for ; Fri, 23 Jan 2026 09:53:16 +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=1769162008; cv=none; b=Bxnyo4NkAG98xPlD0wUukW1iqmqKF97ucUkWfU/pNz7dNu9mf4GQnLaCrBpzkoz1SDko7wpWgEnlVq1UCfCB6O1Juq4/ij83IOyQG6oEee6txW3e0Uizwv6cCcmLZXgonmlB/pKT4mAwbdn+tgGH0+M/gr5/Qu6mGpJnlHFwIug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162008; c=relaxed/simple; bh=R5AMoPM/Ih6mwoFuoVMFh6CXwk8y0zHpmAali8o+Zk4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M2gUTG0mVOuwomhMTe/zg224Nr4oCs0Rz8Aj68rfaV38nR8jOnlG+woUPKD9qLF1fkac6IYQmtE0Dp7hMDPBiyzXZQlCQfOe9M2PKDudPRnyRiXB3PuT7RY445Jidv4ahkaQg6g8hlDKA+nBTOlziRbX2IVj5ytSq63PIPmBjY0= 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=vaNEQXUM; 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="vaNEQXUM" 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=3X3mPWFcgBAY/FYlIZ8l72QzbHZKoW1OyhdLkOYKt/c=; b=vaNEQXUMT7VVeoxK2HmHFq6EcW reAtBPGTSuDFNJ+44gLlQJKueb9i6pfkQbBIl+mu6RG6pRIBktntVlje186icb8U1wWrZCd0PkvYw WZ0By9QSanCMS+Ts62gyNxgWKGXcBho9slzYQtefeG/gpHpumK/UmXxag2IimXTqqkUdNRBpZac+e fbgqkGvwC11eZ2Zxbu9Q4r42LiJM/8EWyPz9KR6VyS5533Pw1WxkpzKeFBZlRGbiVQnZp/ZyJ+J87 lCn3o90GxXeVKmuMsfGmGJWp6sBbsfdxN1IZEL7UqOd/M9ZBoAmM+83qf8scmJ75ZeLkP5kTILQ1z DEhxFLuA==; 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 1vjDql-00000001b4e-1OLb; Fri, 23 Jan 2026 09:53:07 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id D26B23007E1; Fri, 23 Jan 2026 10:53:05 +0100 (CET) Date: Fri, 23 Jan 2026 10:53:05 +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: <20260123095305.GH171111@noisy.programming.kicks-ass.net> References: <22a6976c-357f-40f7-b47f-2654545fc57d@arm.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, 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?