aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-07-12 20:11:00 -0700
committerColin Cross <ccross@android.com>2011-07-12 20:11:00 -0700
commit2340c679cabc5477598ee3c9c2044ec8893d42fd (patch)
tree2cf2848bea005b9d807710f23dc5519191ca8215 /kernel/sched.c
parent9a489d92af45a7d7c1bba9e0803f73f95d2fd13c (diff)
parent620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff)
downloadkernel_samsung_tuna-2340c679cabc5477598ee3c9c2044ec8893d42fd.zip
kernel_samsung_tuna-2340c679cabc5477598ee3c9c2044ec8893d42fd.tar.gz
kernel_samsung_tuna-2340c679cabc5477598ee3c9c2044ec8893d42fd.tar.bz2
Merge commit 'v3.0-rc7' into linux-omap-3.0
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 71bc127..0171be3 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -292,8 +292,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
@@ -8450,10 +8450,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)