lkml.org 
[lkml]   [2011]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] sched: increase SCHED_LOAD_SCALE resolution

* Nikhil Rao <ncrao@google.com> wrote:

> -#define SCHED_LOAD_SHIFT 10
> +#if BITS_PER_LONG > 32
> +#define SCHED_LOAD_RESOLUTION 10
> +#define scale_load(w) (w << SCHED_LOAD_RESOLUTION)
> +#define scale_load_down(w) (w >> SCHED_LOAD_RESOLUTION)
> +#else
> +#define SCHED_LOAD_RESOLUTION 0
> +#define scale_load(w) w
> +#define scale_load_down(w) w
> +#endif

Please use the:

#if X
# define Y A
#else
# define Y B
#endif

type of nested CPP branching style.

Also, the 'w' probably wants to be '(w)', just in case.

> if (!lw->inv_weight) {
> - if (BITS_PER_LONG > 32 && unlikely(lw->weight >= WMULT_CONST))
> + unsigned long w = scale_load_down(lw->weight);
> + if (BITS_PER_LONG > 32 && unlikely(w >= WMULT_CONST))
> lw->inv_weight = 1;

Please separate local variable declarations and the first statement following
it by an extra empty line.

Could you also put all the performance measurement description into the
changelog of this third commit - so that people can see (and enjoy) the
extensive testing you have done on this topic?

Thanks,

Ingo


\
 
 \ /
  Last update: 2011-05-18 20:27    [from the cache]
©2003-2011 Jasper Spaans