lkml.org 
[lkml]   [2011]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC][Patch 02/18] sched: increase SCHED_LOAD_SCALE resolution
    Date
    On Wed, 20 Apr 2011 13:51:21 -0700, Nikhil Rao <ncrao@google.com> wrote:
    > Introduce SCHED_LOAD_RESOLUTION, which scales is added to SCHED_LOAD_SHIFT and
    > increases the resolution of SCHED_LOAD_SCALE. This patch sets the value of
    > SCHED_LOAD_RESOLUTION to 10, scaling up the weights for all sched entities by
    > a factor of 1024. With this extra resolution, we can handle deeper cgroup
    > hiearchies and the scheduler can do better shares distribution and load
    > load balancing on larger systems (especially for low weight task groups).
    >
    > This does not change the existing user interface, the scaled weights are only
    > used internally. We do not modify prio_to_weight values or inverses, but use
    > the original weights when calculating the inverse which is used to scale
    > execution time delta in calc_delta_mine(). This ensures we do not lose accuracy
    > when accounting time to the sched entities.
    >
    > Signed-off-by: Nikhil Rao <ncrao@google.com>
    > ---
    > include/linux/sched.h | 3 ++-
    > kernel/sched.c | 18 ++++++++++--------
    > 2 files changed, 12 insertions(+), 9 deletions(-)
    >
    > diff --git a/include/linux/sched.h b/include/linux/sched.h
    > index 8d1ff2b..d2c3bab 100644
    > --- a/include/linux/sched.h
    > +++ b/include/linux/sched.h
    > @@ -794,7 +794,8 @@ enum cpu_idle_type {
    > /*
    > * Increase resolution of nice-level calculations:
    > */
    > -#define SCHED_LOAD_SHIFT 10
    > +#define SCHED_LOAD_RESOLUTION 10
    > +#define SCHED_LOAD_SHIFT (10 + SCHED_LOAD_RESOLUTION)
    > #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
    >
    > /*
    > diff --git a/kernel/sched.c b/kernel/sched.c
    > index 50f97cc..bfee8ff 100644
    > --- a/kernel/sched.c
    > +++ b/kernel/sched.c
    > @@ -293,7 +293,7 @@ static DEFINE_SPINLOCK(task_group_lock);
    > * limitation from this.)
    > */
    > #define MIN_SHARES 2
    > -#define MAX_SHARES (1UL << 18)
    > +#define MAX_SHARES (1UL << 28)
    Shouldn't this change depend on SCHED_LOAD_RESOLUTION?

    #define MAX_SHARES (1UL << (18 + SCHED_LOAD_RESOLUTION))

    Nikunj


    \
     
     \ /
      Last update: 2011-04-28 11:57    [W:0.024 / U:271.636 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site