Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 22 Jan 2008 17:18:45 +0000 (09:18 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 22 Jan 2008 17:18:45 +0000 (09:18 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: group scheduler, set uid share fix

kernel/sched.c

index 37cf07aa41647741e1581f8120b4cb2a291c5545..e76b11ca6df320648ae32eb122afa80fc4c4faca 100644 (file)
@@ -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;