Skip to content

Commit a57beec

Browse files
Peter Zijlstraingomolnar
authored andcommitted
sched: Make sched_class::get_rr_interval() optional
Not all classes implement (or can implement) a useful get_rr_interval() function, default to a 0 time-slice for them. This fixes a crash reported by Tommi Rantala. Reported-by: Tommi Rantala <tt.rantala@gmail.com> Cc: Dave Jones <davej@redhat.com> Cc: Tommi Rantala <tt.rantala@gmail.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20140127105413.GC11314@laptop.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 712e5e3 commit a57beec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎kernel/sched/core.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4324,7 +4324,9 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
43244324
goto out_unlock;
43254325

43264326
rq = task_rq_lock(p, &flags);
4327-
time_slice = p->sched_class->get_rr_interval(rq, p);
4327+
time_slice = 0;
4328+
if (p->sched_class->get_rr_interval)
4329+
time_slice = p->sched_class->get_rr_interval(rq, p);
43284330
task_rq_unlock(rq, p, &flags);
43294331

43304332
rcu_read_unlock();

0 commit comments

Comments
 (0)