Skip to contentSkip to conversation

sched: remove noop function task_fork_dl

PATCH In review Tom Rix 2 participants 2 messages Nov 27, 2019 – Nov 29, 2019 Scheduler

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 sched: remove noop function task_fork_dl

task_fork_dl is an empty function used only for dl's sched_class.task_fork.  Removing it cleans up the code a bit and saves a function call in sched_fork.

---
 kernel/sched/deadline.c | 10 ----------

 1 file changed, 10 deletions(-)
kernel/sched/deadline.c +0 -0
index a8a08030a8f7..fbafd97d883a 100644
@@ -1821,14 +1821,6 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)

         start_hrtick_dl(rq, p);
 }

-static void task_fork_dl(struct task_struct *p)
-{
-    /*
-     * SCHED_DEADLINE tasks cannot fork and this is achieved through -     * sched_fork()
-     */
-}
-
 #ifdef CONFIG_SMP

 /* Only try algorithms three times */
@@ -2451,8 +2443,6 @@ const struct sched_class dl_sched_class = { #endif

     .task_tick        = task_tick_dl,
-    .task_fork              = task_fork_dl,
-
     .prio_changed           = prio_changed_dl, .switched_from        = switched_from_dl, .switched_to        = switched_to_dl,

Signature · 1 line
2.23.0
#1 lore raw
Quoted 31 lines · Tom Rix

task_fork_dl is an empty function used only for dl's sched_class.task_fork.  Removing it cleans up the code a bit and saves a function call in sched_fork.

---
 kernel/sched/deadline.c | 10 ----------

 1 file changed, 10 deletions(-)
kernel/sched/deadline.c +0 -0
index a8a08030a8f7..fbafd97d883a 100644
@@ -1821,14 +1821,6 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)
          start_hrtick_dl(rq, p);
  }

kernel/sched/deadline.c +0 -8
-static void task_fork_dl(struct task_struct *p)
-{
-    /*
-     * SCHED_DEADLINE tasks cannot fork and this is achieved through
-     * sched_fork()
-     */
-}
-

 #ifdef CONFIG_SMP

 /* Only try algorithms three times */

kernel/sched/deadline.c +0 -0
@@ -2451,8 +2443,6 @@ const struct sched_class dl_sched_class = {
  #endif
Quoted 7 lines


     .task_tick        = task_tick_dl,
-    .task_fork              = task_fork_dl,
-
     .prio_changed           = prio_changed_dl,
     .switched_from        = switched_from_dl,
     .switched_to        = switched_to_dl,

Patch got whitespace-damaged - please see Documentation/process/email-clients.rst of how to send patches with your mail client.

Your patch looks good otherwise.

Thanks,

Ingo