From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08952C4332F for ; Thu, 14 Dec 2023 13:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573238AbjLNNCo (ORCPT ); Thu, 14 Dec 2023 08:02:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573240AbjLNNC1 (ORCPT ); Thu, 14 Dec 2023 08:02:27 -0500 Received: from wxsgout04.xfusion.com (wxsgout03.xfusion.com [36.139.52.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41160D41 for ; Thu, 14 Dec 2023 05:02:24 -0800 (PST) Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4SrXV80JDrzB0xYh; Thu, 14 Dec 2023 20:58:56 +0800 (CST) Received: from localhost (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 14 Dec 2023 21:02:17 +0800 Date: Thu, 14 Dec 2023 21:02:17 +0800 From: Wang Jinchao To: Abel Wu CC: Vincent Guittot , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , , Subject: Re: Re: [PATCH] sched/fair: remove next_buddy_marked Message-ID: References: <202312141319+0800-wangjinchao@xfusion.com> <83099016-f609-4ac0-94ab-909ac9c96582@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <83099016-f609-4ac0-94ab-909ac9c96582@bytedance.com> X-Originating-IP: [10.82.147.3] X-ClientProxiedBy: wuxshcsitd00600.xfusion.com (10.32.133.213) To wuxshcsitd00600.xfusion.com (10.32.133.213) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 14, 2023 at 08:21:53PM +0800, Abel Wu wrote: > On 12/14/23 4:18 PM, Vincent Guittot Wrote: > > On Thu, 14 Dec 2023 at 06:20, Wang Jinchao wrote: > > > > > > Remove unused `next_buddy_marked` in `check_preempt_wakeup_fair` > > > > > > > Fixes: 5e963f2bd465 ("sched/fair: Commit to EEVDF") > > After this commit @pse preempts curr without being the NEXT_BUDDY, but > IMHO it should be, so how about this? > > @@ -8259,8 +8259,11 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int > /* > * XXX pick_eevdf(cfs_rq) != se ? > */ > - if (pick_eevdf(cfs_rq) == pse) > + if (pick_eevdf(cfs_rq) == pse) { > + if (!next_buddy_marked) > + set_next_buddy(pse); > goto preempt; > + } > > return; > > which will align with before. Seizing this opportunity to inquire about a question: What does "buddy" mean in the context of the scheduler? Is the effect the same between preempting after pick_evfd(cfs_rq) == pse and preempting after set_next_buddy(pse) followed by pick_evfd(cfs_rq) == pse? Would both scenarios result in pse becoming the next scheduled se?"