* [PATCH] kernel:sched: renamed max_vruntime parameter
@ 2013-03-12 19:12 Andrei Epure
2013-03-18 10:59 ` [tip:sched/core] sched: Fix variable name misnomer, add comments tip-bot for Andrei Epure
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Epure @ 2013-03-12 19:12 UTC (permalink / raw)
To: mingo, peterz; +Cc: linux-kernel, Andrei Epure
The min_vruntime variable actually stores the maximum value.
The added comment was taken from place_entity function.
Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
---
kernel/sched/fair.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7a33e59..ff4cffb 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -431,13 +431,13 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, unsigned long delta_exec);
* Scheduling class tree data structure manipulation methods:
*/
-static inline u64 max_vruntime(u64 min_vruntime, u64 vruntime)
+static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
{
- s64 delta = (s64)(vruntime - min_vruntime);
+ s64 delta = (s64)(vruntime - max_vruntime);
if (delta > 0)
- min_vruntime = vruntime;
+ max_vruntime = vruntime;
- return min_vruntime;
+ return max_vruntime;
}
static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
@@ -473,6 +473,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
vruntime = min_vruntime(vruntime, se->vruntime);
}
+ /* ensure we never gain time by being placed backwards. */
cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BIT
smp_wmb();
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread* [tip:sched/core] sched: Fix variable name misnomer, add comments
2013-03-12 19:12 [PATCH] kernel:sched: renamed max_vruntime parameter Andrei Epure
@ 2013-03-18 10:59 ` tip-bot for Andrei Epure
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Andrei Epure @ 2013-03-18 10:59 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, epure.andrei, tglx
Commit-ID: 1bf08230f745e48fea9c18ee34a73581631fe7c9
Gitweb: http://git.kernel.org/tip/1bf08230f745e48fea9c18ee34a73581631fe7c9
Author: Andrei Epure <epure.andrei@gmail.com>
AuthorDate: Tue, 12 Mar 2013 21:12:24 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Mar 2013 08:22:29 +0100
sched: Fix variable name misnomer, add comments
The min_vruntime variable actually stores the maximum value.
The added comment was taken from place_entity function.
Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1363115544-1964-1-git-send-email-epure.andrei@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 22bd9e6..539760e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -431,13 +431,13 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, unsigned long delta_exec);
* Scheduling class tree data structure manipulation methods:
*/
-static inline u64 max_vruntime(u64 min_vruntime, u64 vruntime)
+static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
{
- s64 delta = (s64)(vruntime - min_vruntime);
+ s64 delta = (s64)(vruntime - max_vruntime);
if (delta > 0)
- min_vruntime = vruntime;
+ max_vruntime = vruntime;
- return min_vruntime;
+ return max_vruntime;
}
static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
@@ -473,6 +473,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
vruntime = min_vruntime(vruntime, se->vruntime);
}
+ /* ensure we never gain time by being placed backwards. */
cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BIT
smp_wmb();
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-18 11:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-12 19:12 [PATCH] kernel:sched: renamed max_vruntime parameter Andrei Epure
2013-03-18 10:59 ` [tip:sched/core] sched: Fix variable name misnomer, add comments tip-bot for Andrei Epure
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome