aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-07-11 08:15:48 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-11 08:15:55 -0400
commitb7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch)
tree2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /kernel/sched.c
parentc172d82500a6cf3c32d1e650722a1055d72ce858 (diff)
parente3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff)
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that are based on newer code already present upstream.
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 71e5a25a8a58..ad8ab90bb301 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -292,8 +292,8 @@ static DEFINE_SPINLOCK(task_group_lock);
292 * (The default weight is 1024 - so there's no practical 292 * (The default weight is 1024 - so there's no practical
293 * limitation from this.) 293 * limitation from this.)
294 */ 294 */
295#define MIN_SHARES 2 295#define MIN_SHARES (1UL << 1)
296#define MAX_SHARES (1UL << (18 + SCHED_LOAD_RESOLUTION)) 296#define MAX_SHARES (1UL << 18)
297 297
298static int root_task_group_load = ROOT_TASK_GROUP_LOAD; 298static int root_task_group_load = ROOT_TASK_GROUP_LOAD;
299#endif 299#endif
@@ -8449,10 +8449,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
8449 if (!tg->se[0]) 8449 if (!tg->se[0])
8450 return -EINVAL; 8450 return -EINVAL;
8451 8451
8452 if (shares < MIN_SHARES) 8452 shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
8453 shares = MIN_SHARES;
8454 else if (shares > MAX_SHARES)
8455 shares = MAX_SHARES;
8456 8453
8457 mutex_lock(&shares_mutex); 8454 mutex_lock(&shares_mutex);
8458 if (tg->shares == shares) 8455 if (tg->shares == shares)