mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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 <[email protected]> Cc: Dave Jones <[email protected]> Cc: Tommi Rantala <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
712e5e34ae
commit
a57beec5d4
1 file changed
+3
-1
+3
-1
@@ -4324,7 +4324,9 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
|
||||
goto out_unlock;
|
||||
|
||||
rq = task_rq_lock(p, &flags);
|
||||
time_slice = p->sched_class->get_rr_interval(rq, p);
|
||||
time_slice = 0;
|
||||
if (p->sched_class->get_rr_interval)
|
||||
time_slice = p->sched_class->get_rr_interval(rq, p);
|
||||
task_rq_unlock(rq, p, &flags);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
Reference in new issue
Block a user