Skip to content

Commit 0900acf

Browse files
deggemanPeter Zijlstra
authored andcommitted
sched/core: Remove redundant 'preempt' param from sched_class->yield_to_task()
Commit 6d1cafd ("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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 844eb64 commit 0900acf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5810,7 +5810,7 @@ int __sched yield_to(struct task_struct *p, bool preempt)
58105810
if (task_running(p_rq, p) || p->state)
58115811
goto out_unlock;
58125812

5813-
yielded = curr->sched_class->yield_to_task(rq, p, preempt);
5813+
yielded = curr->sched_class->yield_to_task(rq, p);
58145814
if (yielded) {
58155815
schedstat_inc(rq->yld_count);
58165816
/*

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7157,7 +7157,7 @@ static void yield_task_fair(struct rq *rq)
71577157
set_skip_buddy(se);
71587158
}
71597159

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

kernel/sched/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ struct sched_class {
17481748
void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags);
17491749
void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);
17501750
void (*yield_task) (struct rq *rq);
1751-
bool (*yield_to_task)(struct rq *rq, struct task_struct *p, bool preempt);
1751+
bool (*yield_to_task)(struct rq *rq, struct task_struct *p);
17521752

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

0 commit comments

Comments
 (0)