Skip to content

Commit

Permalink
sched/rt: Code cleanup, remove a redundant function call
Browse files Browse the repository at this point in the history
The second call to sched_rt_period() is redundant, because the value of the
rt_runtime was already read and it was protected by the ->rt_runtime_lock.

Signed-off-by: Shan Hai <[email protected]>
Reviewed-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Shan Hai authored and Ingo Molnar committed Dec 6, 2011
1 parent 4d78a22 commit 5b680fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
if (rt_rq->rt_throttled)
return rt_rq_throttled(rt_rq);

if (sched_rt_runtime(rt_rq) >= sched_rt_period(rt_rq))
if (runtime >= sched_rt_period(rt_rq))
return 0;

balance_runtime(rt_rq);
Expand Down

0 comments on commit 5b680fd

Please sign in to comment.