Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-s…
Browse files Browse the repository at this point in the history
…ched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: group scheduler, set uid share fix
  • Loading branch information
Linus Torvalds committed Jan 22, 2008
2 parents 00e1077 + c61935f commit b2214fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b2214fc

Please sign in to comment.