return prio_less() directly to avoid unnecessary checking
Signed-off-by: Li RongQing <[email protected]>
---
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
Ping
-Li
> -----?ʼ?ԭ??-----
> ??????: Li,Rongqing <[email protected]>
> ????ʱ??: 2021??8??24?? 18:19
> ?ռ???: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Li,Rongqing
> <[email protected]>
> ????: [PATCH] sched/core: return prio_less() directly in __sched_core_less
>
> return prio_less() directly to avoid unnecessary checking
>
> Signed-off-by: Li RongQing <[email protected]>
> ---
> 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
Ping
-Li
> -----?ʼ?ԭ??-----
> ??????: Li,Rongqing <[email protected]>
> ????ʱ??: 2021??8??24?? 18:19
> ?ռ???: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Li,Rongqing
> <[email protected]>
> ????: [PATCH] sched/core: return prio_less() directly in __sched_core_less
>
> return prio_less() directly to avoid unnecessary checking
>
> Signed-off-by: Li RongQing <[email protected]>
> ---
> 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