Skip to content

Commit

Permalink
sched/fair: Cleanup task_util and capacity type
Browse files Browse the repository at this point in the history
[ Upstream commit ef8df97 ]

task_util and capacity are comparable unsigned long values. There is no
need for an intermidiate implicit signed cast.

Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211207095755.859972-1-vincent.donnefort@arm.com
Stable-dep-of: 48d5e9d ("sched/uclamp: Fix relationship between uclamp and migration margin")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Vincent Donnefort authored and gregkh committed Dec 31, 2022
1 parent 26bffaf commit 54a766e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/sched/fair.c
Expand Up @@ -4120,7 +4120,8 @@ static inline void util_est_update(struct cfs_rq *cfs_rq,
trace_sched_util_est_se_tp(&p->se);
}

static inline int task_fits_capacity(struct task_struct *p, long capacity)
static inline int task_fits_capacity(struct task_struct *p,
unsigned long capacity)
{
return fits_capacity(uclamp_task_util(p), capacity);
}
Expand Down Expand Up @@ -6398,7 +6399,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
return best_cpu;
}

static inline bool asym_fits_capacity(int task_util, int cpu)
static inline bool asym_fits_capacity(unsigned long task_util, int cpu)
{
if (static_branch_unlikely(&sched_asym_cpucapacity))
return fits_capacity(task_util, capacity_of(cpu));
Expand Down

0 comments on commit 54a766e

Please sign in to comment.