Re: [RFC PATCH v3 5/6] sched/uclamp: Simplify uclamp_eff_value()

From: Hongyan Xia
Date: Tue May 28 2024 - 07:43:00 EST


On 26/05/2024 23:52, Dietmar Eggemann wrote:
On 07/05/2024 14:50, Hongyan Xia wrote:

[...]

+static inline unsigned long uclamp_eff_value(struct task_struct *p,
+ enum uclamp_id clamp_id)
+{
+ if (uclamp_is_used() && p->uclamp[clamp_id].active)
+ return p->uclamp[clamp_id].value;
+
+ if (clamp_id == UCLAMP_MIN)
+ return 0;
+
+ return SCHED_CAPACITY_SCALE;

Why not keep using 'return uclamp_none(clamp_id)' here?

Reason is that uclamp_none() is in core.c.

I could move uclamp_none() into sched.h if needed.