答复: [PATCH] sched/core: return prio_less() directly in __sched_core_less
From: Li,Rongqing
Date: Mon Sep 27 2021 - 09:08:34 EST
Ping
-Li
> -----邮件原件-----
> 发件人: Li,Rongqing <lirongqing@xxxxxxxxx>
> 发送时间: 2021年8月24日 18:19
> 收件人: mingo@xxxxxxxxxx; peterz@xxxxxxxxxxxxx; juri.lelli@xxxxxxxxxx;
> vincent.guittot@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Li,Rongqing
> <lirongqing@xxxxxxxxx>
> 主题: [PATCH] sched/core: return prio_less() directly in __sched_core_less
>
> return prio_less() directly to avoid unnecessary checking
>
> Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
> ---
> kernel/sched/core.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2d9ff40..73478c9
> 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -140,10 +140,7 @@ static inline bool __sched_core_less(struct task_struct
> *a, struct task_struct *
> return false;
>
> /* flip prio, so high prio is leftmost */
> - if (prio_less(b, a, task_rq(a)->core->core_forceidle))
> - return true;
> -
> - return false;
> + return prio_less(b, a, task_rq(a)->core->core_forceidle);
> }
>
> #define __node_2_sc(node) rb_entry((node), struct task_struct, core_node)
> --
> 1.7.1