Unverified Commit 0fac4b66 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6996 sched/fair: Optimize performance by inlining cpu_util_without() and cpu_util()

parents f7c1291d f7f64bb3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8510,7 +8510,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
 *
 * Return: (Boosted) (estimated) utilization for the specified CPU.
 */
static unsigned long
static __always_inline unsigned long
cpu_util(int cpu, struct task_struct *p, int dst_cpu, int boost)
{
	struct cfs_rq *cfs_rq = &cpu_rq(cpu)->cfs;
@@ -8598,7 +8598,7 @@ unsigned long cpu_util_cfs_boost(int cpu)
 * utilization of the specified task, whenever the task is currently
 * contributing to the CPU utilization.
 */
static unsigned long cpu_util_without(int cpu, struct task_struct *p)
static __always_inline unsigned long cpu_util_without(int cpu, struct task_struct *p)
{
	/* Task has no contribution or is new */
	if (cpu != task_cpu(p) || !READ_ONCE(p->se.avg.last_update_time))