diff options
author | Colin Cross <ccross@android.com> | 2011-07-12 20:10:37 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-07-12 20:10:37 -0700 |
commit | 75c56a81116e51c5cf15c0641906d0745188cd16 (patch) | |
tree | c1d8e7def5bbb099a39d5e9ccfb13508ea5ca46a /kernel/sched.c | |
parent | b4294d618e8a19bb47826e51ae52b9fb2fe05f80 (diff) | |
parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) | |
download | kernel_samsung_espresso10-75c56a81116e51c5cf15c0641906d0745188cd16.zip kernel_samsung_espresso10-75c56a81116e51c5cf15c0641906d0745188cd16.tar.gz kernel_samsung_espresso10-75c56a81116e51c5cf15c0641906d0745188cd16.tar.bz2 |
Merge commit 'v3.0-rc7' into android-3.0
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1b59806..05735d3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -293,8 +293,8 @@ static DEFINE_SPINLOCK(task_group_lock); * (The default weight is 1024 - so there's no practical * limitation from this.) */ -#define MIN_SHARES 2 -#define MAX_SHARES (1UL << (18 + SCHED_LOAD_RESOLUTION)) +#define MIN_SHARES (1UL << 1) +#define MAX_SHARES (1UL << 18) static int root_task_group_load = ROOT_TASK_GROUP_LOAD; #endif @@ -8462,10 +8462,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares) if (!tg->se[0]) return -EINVAL; - if (shares < MIN_SHARES) - shares = MIN_SHARES; - else if (shares > MAX_SHARES) - shares = MAX_SHARES; + shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES)); mutex_lock(&shares_mutex); if (tg->shares == shares) |