[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <863ba31e-8df3-4168-acfc-503bfe1a0aac@bytedance.com>
Date: Thu, 14 Dec 2023 21:40:56 +0800
From: Abel Wu <wuyun.abel@...edance.com>
To: Wang Jinchao <wangjinchao@...sion.com>
Cc: Vincent Guittot <vincent.guittot@...aro.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
linux-kernel@...r.kernel.org, stone.xulei@...sion.com
Subject: Re: Re: Re: [PATCH] sched/fair: remove next_buddy_marked
On 12/14/23 9:02 PM, Wang Jinchao Wrote:
> 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 <wangjinchao@...sion.com> 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?
struct sched_entity
>
> 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?"
Probably, since pse is the one preempts curr, pick_next_entity() could
return pse directly without walking the rbtree. So the difference is in
performance.
Powered by blists - more mailing lists