[PATCH 2/4] sched/core: Remove redundant 'preempt' param from sched_class->yield_to_task()

From: Dietmar Eggemann
Date: Wed Jun 03 2020 - 04:03:39 EST


Commit 6d1cafd8b56e ("sched: Resched proper CPU on yield_to()") moved
the code to resched the CPU from yield_to_task_fair() to yield_to()
making the preempt parameter in sched_class->yield_to_task()
unnecessary. Remove it. No other sched_class implements yield_to_task().

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
---
kernel/sched/core.c | 2 +-
kernel/sched/fair.c | 2 +-
kernel/sched/sched.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 95e457d4ed1c..687b16047f92 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5812,7 +5812,7 @@ int __sched yield_to(struct task_struct *p, bool preempt)
if (task_running(p_rq, p) || p->state)
goto out_unlock;

- yielded = curr->sched_class->yield_to_task(rq, p, preempt);
+ yielded = curr->sched_class->yield_to_task(rq, p);
if (yielded) {
schedstat_inc(rq->yld_count);
/*
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index dda9b194d225..5c4a559d0dae 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7158,7 +7158,7 @@ static void yield_task_fair(struct rq *rq)
set_skip_buddy(se);
}

-static bool yield_to_task_fair(struct rq *rq, struct task_struct *p, bool preempt)
+static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
{
struct sched_entity *se = &p->se;

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 4b32cff0dcbe..12a0d0c7c164 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1752,7 +1752,7 @@ struct sched_class {
void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags);
void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);
void (*yield_task) (struct rq *rq);
- bool (*yield_to_task)(struct rq *rq, struct task_struct *p, bool preempt);
+ bool (*yield_to_task)(struct rq *rq, struct task_struct *p);

void (*check_preempt_curr)(struct rq *rq, struct task_struct *p, int flags);

--
2.17.1