[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6db95fce-842e-4b99-bc6c-059fe655905f@kernel.org>
Date: Thu, 11 Apr 2024 09:28:04 +0200
From: Daniel Bristot de Oliveira <bristot@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
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, Luca Abeni <luca.abeni@...tannapisa.it>,
Tommaso Cucinotta <tommaso.cucinotta@...tannapisa.it>,
Thomas Gleixner <tglx@...utronix.de>, Joel Fernandes
<joel@...lfernandes.org>, Vineeth Pillai <vineeth@...byteword.org>,
Shuah Khan <skhan@...uxfoundation.org>, Phil Auld <pauld@...hat.com>,
Suleiman Souhlal <suleiman@...gle.com>,
Youssef Esmat <youssefesmat@...gle.com>
Subject: Re: [PATCH V6 1/6] sched/fair: Add trivial fair server
On 4/10/24 19:24, Peter Zijlstra wrote:
> On Fri, Apr 05, 2024 at 07:28:00PM +0200, Daniel Bristot de Oliveira wrote:
>> From: Peter Zijlstra <peterz@...radead.org>
>>
>> Use deadline servers to service fair tasks.
>>
>> This patch adds a fair_server deadline entity which acts as a container
>> for fair entities and can be used to fix starvation when higher priority
>> (wrt fair) tasks are monopolizing CPU(s).
>>
>> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
>> Signed-off-by: Daniel Bristot de Oliveira <bristot@...nel.org>
>> ---
>> kernel/sched/core.c | 24 ++++++++++++++++--------
>> kernel/sched/deadline.c | 23 +++++++++++++++++++++++
>> kernel/sched/fair.c | 25 +++++++++++++++++++++++++
>> kernel/sched/sched.h | 4 ++++
>> 4 files changed, 68 insertions(+), 8 deletions(-)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index 7019a40457a6..04e2270487b7 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -6007,6 +6007,14 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
>> #endif
>>
>> put_prev_task(rq, prev);
>> +
>> + /*
>> + * We've updated @prev and no longer need the server link, clear it.
>> + * Must be done before ->pick_next_task() because that can (re)set
>> + * ->dl_server.
>> + */
>> + if (prev->dl_server)
>> + prev->dl_server = NULL;
>> }
>>
>> /*
>> @@ -6037,6 +6045,13 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>> p = pick_next_task_idle(rq);
>> }
>>
>> + /*
>> + * This is a normal CFS pick, but the previous could be a DL pick.
>> + * Clear it as previous is no longer picked.
>> + */
>> + if (prev->dl_server)
>> + prev->dl_server = NULL;
>> +
>> /*
>> * This is the fast path; it cannot be a DL server pick;
>> * therefore even if @p == @prev, ->dl_server must be NULL.
>> @@ -6050,14 +6065,6 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>> restart:
>> put_prev_task_balance(rq, prev, rf);
>>
>> - /*
>> - * We've updated @prev and no longer need the server link, clear it.
>> - * Must be done before ->pick_next_task() because that can (re)set
>> - * ->dl_server.
>> - */
>> - if (prev->dl_server)
>> - prev->dl_server = NULL;
>> -
>> for_each_class(class) {
>> p = class->pick_next_task(rq);
>> if (p)
>
> This bit seems like a fix for 63ba8422f876 ("sched/deadline: Introduce
> deadline servers"), should it be a separate patch?
It was actually reported in a separated patch as a pre-review of this series. So I
think you can pick them as fixes already from there, and add the fixes tag?
https://lore.kernel.org/lkml/20240313012451.1693807-2-joel@joelfernandes.org/
https://lore.kernel.org/lkml/20240313012451.1693807-3-joel@joelfernandes.org/
Also add the Reviewed-by me...
-- Daniel
Powered by blists - more mailing lists