Skip to contentSkip to conversation

sched/fair: Fix update min_vruntime in dequeue_entity()

PATCH New Song Muchun 2 participants 2 messages Oct 14, 2018 – Oct 16, 2018 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Fix update min_vruntime in dequeue_entity()

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")
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 585d5726338b..ee271bb661cc 100644
@@ -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);
 }
 
Signature · 1 line
2.17.1
#1 lore raw

[tip:sched/urgent] sched/fair: Fix the min_vruntime update logic in dequeue_entity()

sched/fair: Fix the min_vruntime update logic in dequeue_entity()
Commit-ID:  9845c49cc9bbb317a0bc9e9cf78d8e09d54c9af0
Gitweb:     https://git.kernel.org/tip/9845c49cc9bbb317a0bc9e9cf78d8e09d54c9af0
Author:     Song Muchun <[email protected]>
AuthorDate: Sun, 14 Oct 2018 19:26:12 +0800
Committer:  Ingo Molnar <[email protected]>
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.

Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes b60205c7c558 ("sched/fair: Fix min_vruntime tracking")
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index f88e00705b55..908c9cdae2f0 100644
@@ -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);
 }