From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: [git] CFS-devel, group scheduler, fixes
Date: Tue, 18 Sep 2007 21:46:38 +0200 [thread overview]
Message-ID: <1190144798.5204.32.camel@earth> (raw)
(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 <dmitry.adamushko@gmail.com>
---
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9fd936f..3728cd6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -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);
diff --git a/kernel/sched.c b/kernel/sched.c
index 046dae1..361fad8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 5a244e2..9b982ef 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -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);
}
/*
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 45b339f..b86944c 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -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
next reply other threads:[~2007-09-18 19:46 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 19:46 Dmitry Adamushko [this message]
2007-09-18 20:17 ` [git] CFS-devel, group scheduler, fixes Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2007-09-18 19:56 Dmitry Adamushko
2007-09-18 20:18 ` Ingo Molnar
2007-09-18 19:36 dimm
2007-09-18 20:16 ` Ingo Molnar
2007-09-19 6:03 ` Tong Li
2007-09-19 6:28 ` Mike Galbraith
2007-09-19 7:51 ` Mike Galbraith
2007-09-19 8:42 ` Mike Galbraith
2007-09-19 17:06 ` Tong Li
2007-09-20 4:55 ` Mike Galbraith
2007-09-20 7:15 ` Mike Galbraith
2007-09-20 7:51 ` Ingo Molnar
2007-09-20 8:11 ` Mike Galbraith
2007-09-22 3:27 ` Tong Li
2007-09-22 10:01 ` Mike Galbraith
2007-09-23 7:14 ` Mike Galbraith
2007-09-23 11:37 ` Mike Galbraith
2007-09-24 6:21 ` Tong Li
2007-09-24 10:10 ` Mike Galbraith
2007-09-24 10:24 ` Peter Zijlstra
2007-09-24 10:42 ` Mike Galbraith
2007-09-24 11:08 ` Peter Zijlstra
2007-09-24 11:43 ` Mike Galbraith
2007-09-24 11:22 ` Mike Galbraith
2007-09-24 11:51 ` Peter Zijlstra
2007-09-24 16:43 ` Tong Li
2007-09-20 19:48 ` Willy Tarreau
2007-09-21 2:40 ` Mike Galbraith
2007-09-21 3:11 ` Willy Tarreau
2007-09-19 19:35 ` Siddha, Suresh B
2007-09-19 20:58 ` Tong Li
2007-09-18 20:22 ` Ingo Molnar
2007-09-19 3:55 ` Srivatsa Vaddagiri
2007-09-15 13:06 Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1190144798.5204.32.camel@earth \
--to=dmitry.adamushko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=vatsa@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.