From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14F1E3EBF16 for ; Fri, 23 Jan 2026 11:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769167976; cv=none; b=iy3faDc3Z5oRQ3230pxHovc5nGYruhk5ypxhc3CtKjC8hEdEZB5KT/LZje/E4Z/6jzaHBQxXONDgDbUYIMpW3rMxE9yopikJXwKJIr17YnDPlciED5NG7X4cXxhDFiW68buXWsfnQmCaj2Sq692hENeL5KM5moQJOSAPRAcoZ8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769167976; c=relaxed/simple; bh=q6NigcS4EfBS1CTbD80naSP4mF5xIfYzeTnIDihLnMQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oQBFraI3wJr0xPe/3ANRglXGCV0XBwfC4erc2fKsZkcC8yUNR4H8Tau6Hwli+s6CXqeU+UgHHG5b0TpaEUXwHAGxHjenTH/DCyIqr6C+CAq5nuGdnsZzPNmnNXczKgHJrb7PB/jhLSDblIL03aRau51cxb2bzKT9jfhUr8EbIKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E4E361476; Fri, 23 Jan 2026 03:32:47 -0800 (PST) Received: from [10.57.80.101] (unknown [10.57.80.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0BAB03F632; Fri, 23 Jan 2026 03:32:52 -0800 (PST) Message-ID: Date: Fri, 23 Jan 2026 11:32:51 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sched/fair: Disable scheduler feature NEXT_BUDDY Content-Language: en-GB To: Vincent Guittot , Peter Zijlstra Cc: Mel Gorman , Ingo Molnar , Madadi Vineeth Reddy , Juri Lelli , Dietmar Eggemann , Valentin Schneider , Chris Mason , linux-kernel@vger.kernel.org, Christian.Loehle@arm.com References: <22a6976c-357f-40f7-b47f-2654545fc57d@arm.com> <20260123095305.GH171111@noisy.programming.kicks-ass.net> <20260123100915.GL171111@noisy.programming.kicks-ass.net> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 23/01/2026 10:42, Vincent Guittot wrote: > On Fri, 23 Jan 2026 at 11:09, Peter Zijlstra wrote: >> >> 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 :-) > > I sent it. > https://lore.kernel.org/all/20260123102858.52428-1-vincent.guittot@linaro.org/ This is needed in addition to Mel's patch to disable NEXT_BUDDY, right? I'll kick off another benchmark run and report back on Monday.