[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-a57beec5d427086cdc8d75fd51164577193fa7f4@git.kernel.org>
Date: Tue, 28 Jan 2014 11:22:32 -0800
From: tip-bot for Peter Zijlstra <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, davej@...hat.com, tt.rantala@...il.com,
tglx@...utronix.de
Subject: [tip:sched/numa] sched: Make sched_class::get_rr_interval()
optional
Commit-ID: a57beec5d427086cdc8d75fd51164577193fa7f4
Gitweb: http://git.kernel.org/tip/a57beec5d427086cdc8d75fd51164577193fa7f4
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Mon, 27 Jan 2014 11:54:13 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 28 Jan 2014 13:08:41 +0100
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@...il.com>
Cc: Dave Jones <davej@...hat.com>
Cc: Tommi Rantala <tt.rantala@...il.com>
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20140127105413.GC11314@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 36c951b..81343d6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -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();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists