* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched: sched: group scheduler, set uid share fix
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -7153,6 +7153,14 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares) · 7152 unmodified lines | |||
| 7153 | { | 7153 | { |
| 7154 | int i; | 7154 | int i; |
| 7155 | 7155 | ||
| 7156 | /* | ||
| 7157 | * A weight of 0 or 1 can cause arithmetics problems. | ||
| 7158 | * (The default weight is 1024 - so there's no practical | ||
| 7159 | * limitation from this.) | ||
| 7160 | */ | ||
| 7161 | if (shares < 2) | ||
| 7162 | shares = 2; | ||
| 7163 | |||
| 7156 | spin_lock(&tg->lock); | 7164 | spin_lock(&tg->lock); |
| 7157 | if (tg->shares == shares) | 7165 | if (tg->shares == shares) |
| 7158 | goto done; | 7166 | goto done; |