[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c5d40522-037d-e324-697b-23e5e4686d58@redhat.com>
Date: Fri, 26 Aug 2022 09:10:08 +0200
From: Daniel Bristot de Oliveira <bristot@...hat.com>
To: Shang XiaoJing <shangxiaojing@...wei.com>
Cc: mingo@...hat.com, peterz@...radead.org, vincent.guittot@...aro.org,
juri.lelli@...hat.com, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] sched/deadline: Add compare_task_rq helper
On 8/26/22 05:11, Shang XiaoJing wrote:
> Wrap repeated code in helper function compare_task_rq, which return true
> if there is no deadline task on the rq at all, or task's deadline
> earlier than the rq.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@...wei.com>
> ---
> kernel/sched/deadline.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index d116d2b9d2f9..4a40a462717c 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1810,6 +1810,13 @@ static void yield_task_dl(struct rq *rq)
>
> #ifdef CONFIG_SMP
I see the value of this helper, but "compare_task_rq" is making things more confuse.
Choose a more descriptive name, like, dl_task_is_earliest_deadline() ?
> +static inline bool compare_task_rq(struct task_struct *p, struct rq *rq)
> +{
> + return (!rq->dl.dl_nr_running ||
> + dl_time_before(p->dl.deadline,
> + rq->dl.earliest_dl.curr));
> +}
> +
-- Daniel
Powered by blists - more mailing lists