Skip to content

Commit

Permalink
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: fix deadlock in setting scheduler parameter to zero
  sched: fix 2.6.27-rc5 couldn't boot on tulsa machine randomly
  • Loading branch information
torvalds committed Sep 19, 2008
2 parents 902f2ac + ec5d498 commit b4df9d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8909,6 +8909,9 @@ static int sched_rt_global_constraints(void)
u64 rt_runtime, rt_period;
int ret = 0;

if (sysctl_sched_rt_period <= 0)
return -EINVAL;

rt_period = ktime_to_ns(tg->rt_bandwidth.rt_period);
rt_runtime = tg->rt_bandwidth.rt_runtime;

Expand All @@ -8925,6 +8928,9 @@ static int sched_rt_global_constraints(void)
unsigned long flags;
int i;

if (sysctl_sched_rt_period <= 0)
return -EINVAL;

spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags);
for_each_possible_cpu(i) {
struct rt_rq *rt_rq = &cpu_rq(i)->rt;
Expand Down
1 change: 1 addition & 0 deletions kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ static void __enable_runtime(struct rq *rq)
spin_lock(&rt_rq->rt_runtime_lock);
rt_rq->rt_runtime = rt_b->rt_runtime;
rt_rq->rt_time = 0;
rt_rq->rt_throttled = 0;
spin_unlock(&rt_rq->rt_runtime_lock);
spin_unlock(&rt_b->rt_runtime_lock);
}
Expand Down

0 comments on commit b4df9d8

Please sign in to comment.