diff options
Diffstat (limited to 'kernel')
| -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 3f2e502d609b..9769c756ad66 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 | ||
| 298 | static int root_task_group_load = ROOT_TASK_GROUP_LOAD; | 298 | static int root_task_group_load = ROOT_TASK_GROUP_LOAD; |
| 299 | #endif | 299 | #endif |
| @@ -8450,10 +8450,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares) | |||
| 8450 | if (!tg->se[0]) | 8450 | if (!tg->se[0]) |
| 8451 | return -EINVAL; | 8451 | return -EINVAL; |
| 8452 | 8452 | ||
| 8453 | if (shares < MIN_SHARES) | 8453 | shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES)); |
| 8454 | shares = MIN_SHARES; | ||
| 8455 | else if (shares > MAX_SHARES) | ||
| 8456 | shares = MAX_SHARES; | ||
| 8457 | 8454 | ||
| 8458 | mutex_lock(&shares_mutex); | 8455 | mutex_lock(&shares_mutex); |
| 8459 | if (tg->shares == shares) | 8456 | if (tg->shares == shares) |
