Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
Merge commit. Changes below are compared with the first parent: 00e10776.
Changes
1 files changed · +8 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/sched.c | modified | +8 | −0 | View file |
kernel/sched.c
View filediff --git a/kernel/sched.c b/kernel/sched.c
index 37cf07a..e76b11c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7153,6 +7153,14 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
{
int i;
+ /*
+ * A weight of 0 or 1 can cause arithmetics problems.
+ * (The default weight is 1024 - so there's no practical
+ * limitation from this.)
+ */
+ if (shares < 2)
+ shares = 2;
+
spin_lock(&tg->lock);
if (tg->shares == shares)
goto done;