lkml.org 
[lkml]   [2014]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2 v4] sched: Rewrite per entity runnable load average tracking
On Mon, Jul 28, 2014 at 12:48:37PM +0200, Peter Zijlstra wrote:
> > +static __always_inline u64 decay_load(u64 val, u64 n)
> > +{
> > + if (likely(val <= UINT_MAX))
> > + val = decay_load32(val, n);
> > + else {
> > + val *= (u32)decay_load32(1 << 15, n);
> > + val >>= 15;
> > + }
> > +
> > + return val;
> > +}
>
> Please just use mul_u64_u32_shr().
>
> /me continues reading the rest of it..

Good. Since 128bit is considered in mul_u64_u32_shr, load_sum can
afford more tasks :)


\
 
 \ /
  Last update: 2014-07-29 12:21    [W:1.490 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site