Skip to content

Commit e3e76a6

Browse files
deggemanPeter Zijlstra
authored andcommitted
sched/idle,stop: Remove .get_rr_interval from sched_class
The idle task and stop task sched_classes return 0 in this function. The single call site in sched_rr_get_interval() calls p->sched_class->get_rr_interval() only conditional in case it is defined. Otherwise time_slice=0 will be used. The deadline sched class does not define it. Commit a57beec ("sched: Make sched_class::get_rr_interval() optional") introduced the default time-slice=0 for sched classes which do not provide this function. So .get_rr_interval for idle and stop sched_class can be removed to shrink the code a little. Signed-off-by: Dietmar Eggemann <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 0900acf commit e3e76a6

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

kernel/sched/idle.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,6 @@ prio_changed_idle(struct rq *rq, struct task_struct *p, int oldprio)
446446
BUG();
447447
}
448448

449-
static unsigned int get_rr_interval_idle(struct rq *rq, struct task_struct *task)
450-
{
451-
return 0;
452-
}
453-
454449
static void update_curr_idle(struct rq *rq)
455450
{
456451
}
@@ -479,8 +474,6 @@ const struct sched_class idle_sched_class = {
479474

480475
.task_tick = task_tick_idle,
481476

482-
.get_rr_interval = get_rr_interval_idle,
483-
484477
.prio_changed = prio_changed_idle,
485478
.switched_to = switched_to_idle,
486479
.update_curr = update_curr_idle,

kernel/sched/stop_task.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ prio_changed_stop(struct rq *rq, struct task_struct *p, int oldprio)
102102
BUG(); /* how!?, what priority? */
103103
}
104104

105-
static unsigned int
106-
get_rr_interval_stop(struct rq *rq, struct task_struct *task)
107-
{
108-
return 0;
109-
}
110-
111105
static void update_curr_stop(struct rq *rq)
112106
{
113107
}
@@ -136,8 +130,6 @@ const struct sched_class stop_sched_class = {
136130

137131
.task_tick = task_tick_stop,
138132

139-
.get_rr_interval = get_rr_interval_stop,
140-
141133
.prio_changed = prio_changed_stop,
142134
.switched_to = switched_to_stop,
143135
.update_curr = update_curr_stop,

0 commit comments

Comments
 (0)