CFS-devel, group scheduler, fixes
(2)
the 'p' (task_struct) parameter in the sched_class :: yield_task() is redundant as the caller is always the 'current'. Get rid of it.
Signed-off-by Dmitry Adamushko <[email protected]>
---
include/linux/sched.h +1 -1
@@ -857,7 +857,7 @@ struct sched_class {void (*enqueue_task) (struct rq *rq,struct task_struct *p,int wakeup);void (*dequeue_task) (struct rq *rq,struct task_struct *p,int sleep); -void (*yield_task) (struct rq *rq,struct task_struct *p); +void (*yield_task) (struct rq *rq);void (*check_preempt_curr) (struct rq *rq,struct task_struct *p);
kernel/sched.c +1 -1
@@ -4535,7 +4535,7 @@ asmlinkage long sys_sched_yield(void)if (unlikely (rq->nr_running ==1 ))schedstat_inc (rq, yld_act_empty);else - current->sched_class->yield_task (rq, current); + current->sched_class->yield_task (rq);/* * Since we are going to call schedule() anyway, there's
kernel/sched_fair.c +6 -5
@@ -723,10 +723,12 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep)/* * sched_yield() support is very simple - we dequeue and enqueue */ -static void yield_task_fair (struct rq *rq,struct task_struct *p) +static void yield_task_fair (struct rq *rq) { +struct task_struct *curr = rq->curr; +struct cfs_rq *cfs_rq =task_cfs_rq (curr); +if (!sysctl_sched_yield_bug_workaround) { -struct cfs_rq *cfs_rq =task_cfs_rq (p);__update_rq_clock (rq);/*
@@ -737,7 +739,6 @@ static void yield_task_fair(struct rq *rq, struct task_struct *p) }if (sysctl_sched_yield_bug_workaround ==1 ) { -struct cfs_rq *cfs_rq =task_cfs_rq (p);struct sched_entity *next;/*
@@ -757,7 +758,7 @@ static void yield_task_fair(struct rq *rq, struct task_struct *p)/* * Minimally necessary key value to be the second in the tree: */ - p->se.vruntime = next->vruntime + + curr->se.vruntime = next->vruntime + sysctl_sched_yield_granularity;/*
@@ -770,7 +771,7 @@ static void yield_task_fair(struct rq *rq, struct task_struct *p)/* * Just reschedule, do nothing else: */ -resched_task (p); +resched_task (curr); }/*
kernel/sched_rt.c +2 -2
@@ -59,9 +59,9 @@ static void requeue_task_rt(struct rq *rq, struct task_struct *p) }static void -yield_task_rt (struct rq *rq,struct task_struct *p) +yield_task_rt (struct rq *rq) { -requeue_task_rt (rq, p); +requeue_task_rt (rq, rq->curr); }/*
---
Dmitry
Quoted 6 lines · Dmitry Adamushko
(2)
the 'p' (
task_struct) parameter in thesched_class::yield_task()is redundant as the caller is always the 'current'. Get rid of it.Signed-off-by Dmitry Adamushko <[email protected]>
ah - good one! I completely forgot about that parameter and it's indeed unneeded. Applied.
Ingo