* [PATCH] sched/fair: Fix update min_vruntime in dequeue_entity()
@ 2018-10-14 11:26 Song Muchun
2018-10-16 9:15 ` [tip:sched/urgent] sched/fair: Fix the min_vruntime update logic " tip-bot for Song Muchun
0 siblings, 1 reply; 2+ messages in thread
From: Song Muchun @ 2018-10-14 11:26 UTC (permalink / raw)
To: mingo, mingo, peterz; +Cc: linux-kernel
The comment and the code around 2nd update_min_vruntime() are
not in agreement. From commit b60205c7c558 ("sched/fair: Fix
min_vruntime tracking"), I think that we want to update min_vruntime
when a task is sleeping/migrating. So, the check is inverted there.
Fixes: b60205c7c558 ("sched/fair: Fix min_vruntime tracking")
Signed-off-by: Song Muchun <smuchun@gmail.com>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 585d5726338b..ee271bb661cc 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4003,7 +4003,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
* put back on, and if we advance min_vruntime, we'll be placed back
* further than we started -- ie. we'll be penalized.
*/
- if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) == DEQUEUE_SAVE)
+ if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) != DEQUEUE_SAVE)
update_min_vruntime(cfs_rq);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:sched/urgent] sched/fair: Fix the min_vruntime update logic in dequeue_entity()
2018-10-14 11:26 [PATCH] sched/fair: Fix update min_vruntime in dequeue_entity() Song Muchun
@ 2018-10-16 9:15 ` tip-bot for Song Muchun
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Song Muchun @ 2018-10-16 9:15 UTC (permalink / raw)
To: linux-tip-commits
Cc: peterz, linux-kernel, torvalds, tglx, hpa, smuchun, mingo, efault
Commit-ID: 9845c49cc9bbb317a0bc9e9cf78d8e09d54c9af0
Gitweb: https://git.kernel.org/tip/9845c49cc9bbb317a0bc9e9cf78d8e09d54c9af0
Author: Song Muchun <smuchun@gmail.com>
AuthorDate: Sun, 14 Oct 2018 19:26:12 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 16 Oct 2018 09:36:01 +0200
sched/fair: Fix the min_vruntime update logic in dequeue_entity()
The comment and the code around the update_min_vruntime() call in
dequeue_entity() are not in agreement.
From commit:
b60205c7c558 ("sched/fair: Fix min_vruntime tracking")
I think that we want to update min_vruntime when a task is sleeping/migrating.
So, the check is inverted there - fix it.
Signed-off-by: Song Muchun <smuchun@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: b60205c7c558 ("sched/fair: Fix min_vruntime tracking")
Link: http://lkml.kernel.org/r/20181014112612.2614-1-smuchun@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f88e00705b55..908c9cdae2f0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4001,7 +4001,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
* put back on, and if we advance min_vruntime, we'll be placed back
* further than we started -- ie. we'll be penalized.
*/
- if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) == DEQUEUE_SAVE)
+ if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) != DEQUEUE_SAVE)
update_min_vruntime(cfs_rq);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-16 9:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-14 11:26 [PATCH] sched/fair: Fix update min_vruntime in dequeue_entity() Song Muchun
2018-10-16 9:15 ` [tip:sched/urgent] sched/fair: Fix the min_vruntime update logic " tip-bot for Song Muchun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).