lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 19 Jun 2019 09:57:14 -0400
From:   Rik van Riel <riel@...riel.com>
To:     Dietmar Eggemann <dietmar.eggemann@....com>, peterz@...radead.org
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org, kernel-team@...com,
        morten.rasmussen@....com, tglx@...utronix.de,
        dietmar.eggeman@....com, mgorman@...hsingularity.com,
        vincent.guittot@...aro.org
Subject: Re: [PATCH 1/8] sched: introduce task_se_h_load helper

On Wed, 2019-06-19 at 14:52 +0200, Dietmar Eggemann wrote:

> > @@ -7833,14 +7834,19 @@ static void update_cfs_rq_h_load(struct
> > cfs_rq *cfs_rq)
> >  	}
> >  }
> >  
> > -static unsigned long task_h_load(struct task_struct *p)
> > +static unsigned long task_se_h_load(struct sched_entity *se)
> >  {
> > -	struct cfs_rq *cfs_rq = task_cfs_rq(p);
> > +	struct cfs_rq *cfs_rq = cfs_rq_of(se);
> >  
> >  	update_cfs_rq_h_load(cfs_rq);
> > -	return div64_ul(p->se.avg.load_avg * cfs_rq->h_load,
> > +	return div64_ul(se->avg.load_avg * cfs_rq->h_load,
> >  			cfs_rq_load_avg(cfs_rq) + 1);
> >  }
> 
> I wonder if this is necessary. I placed a BUG_ON(!entity_is_task(se))
> into task_se_h_load() after I applied the whole patch-set and ran
> some
> taskgroup related testcases. It didn't hit.
> 
> So why not use task_h_load(task_of(se)) instead?
> 
> [...]

That would work, but task_h_load then dereferences
task->se to get the se->avg.load_avg value.

Going back to task from the se, only to then get the
se from the task seems a little unnecessary :)

Can you explain why you think task_h_load(task_of(se))
would be better? I think I may be overlooking something.

-- 
All Rights Reversed.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists