lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 03/16] sched/core: uclamp: add CPU's clamp groups accounting
On Fri, Sep 14, 2018 at 10:07:51AM +0100, Patrick Bellasi wrote:
> On 13-Sep 21:12, Peter Zijlstra wrote:
> > On Tue, Aug 28, 2018 at 02:53:11PM +0100, Patrick Bellasi wrote:
> > > +static inline void uclamp_cpu_get_id(struct task_struct *p,
> > > + struct rq *rq, int clamp_id)
> > > +{
> > > + struct uclamp_group *uc_grp;
> > > + struct uclamp_cpu *uc_cpu;
> > > + int clamp_value;
> > > + int group_id;
> > > +
> > > + /* Every task must reference a clamp group */
> > > + group_id = p->uclamp[clamp_id].group_id;
> >
> > > +}
> > > +
> > > +static inline void uclamp_cpu_put_id(struct task_struct *p,
> > > + struct rq *rq, int clamp_id)
> > > +{
> > > + struct uclamp_group *uc_grp;
> > > + struct uclamp_cpu *uc_cpu;
> > > + unsigned int clamp_value;
> > > + int group_id;
> > > +
> > > + /* New tasks don't have a previous clamp group */
> > > + group_id = p->uclamp[clamp_id].group_id;
> > > + if (group_id == UCLAMP_NOT_VALID)
> > > + return;
> >
> > *confused*, so on enqueue they must have a group_id, but then on dequeue
> > they might no longer have?
>
> Why not ?

That's what it says on the tin, right? enqueue: "every task must reference clamp
group" while on dequeue: "new tasks don't have a (previous) clamp group"
and we check for NOT_VALID.

\
 
 \ /
  Last update: 2018-09-14 13:52    [W:0.540 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site