Skip to contentSkip to conversation

sched/fair: Fix the misuse of cfs_rq in sync_throttle()

PATCH In review Xunlei Pang 4 participants 4 messages Jul 9, 2016 – Aug 10, 2016 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Fix the misuse of cfs_rq in sync_throttle()

Should update "cfs_rq->throttled_clock_task" other than pcfs_rq's.

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 4088eed..039de34 100644
@@ -4269,7 +4269,7 @@ static void sync_throttle(struct task_group *tg, int cpu)
 	pcfs_rq = tg->parent->cfs_rq[cpu];
 
 	cfs_rq->throttle_count = pcfs_rq->throttle_count;
-	pcfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
+	cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
 }
 
 /* conditionally throttle active cfs_rq's from put_prev_entity() */
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · Xunlei Pang

Should update "cfs_rq->throttled_clock_task" other than pcfs_rq's.

Ack

Quoted 20 lines
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -2
index 4088eed..039de34 100644
@@ -4269,7 +4269,7 @@ static void sync_throttle(struct task_group *tg, int cpu)
        pcfs_rq = tg->parent->cfs_rq[cpu];
 
        cfs_rq->throttle_count = pcfs_rq->throttle_count;
-       pcfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
+       cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
 }
 
 /* conditionally throttle active cfs_rq's from put_prev_entity() */
--

1.8.3.1

maintainer
#2 lore raw
In reply to Xunlei Pang

kernel/sched/fair.c static void sync_throttle(struct task_group *tg, int cpu) · line 4272

Quoted 7 lines · Xunlei Pang

+++ b/kernel/sched/fair.c

kernel/sched/fair.c +1 -1
@@ -4269,7 +4269,7 @@ static void sync_throttle(struct task_group *tg, int cpu)
 	pcfs_rq = tg->parent->cfs_rq[cpu];
 
 	cfs_rq->throttle_count = pcfs_rq->throttle_count;
-	pcfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
+	cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));

Ah indeed, thanks!

Quoted 6 lines
kernel/sched/fair.c +0 -0
 }
 
 /* conditionally throttle active cfs_rq's from put_prev_entity() */
Signature · 1 line
1.8.3.1
#3 lore raw

[tip:sched/core] sched/fair: Fix typo in sync_throttle()

In reply to Xunlei Pang
sched/fair: Fix typo in sync_throttle()
Commit-ID:  b8922125e4790fa237a8a4204562ecf457ef54bb
Gitweb:     http://git.kernel.org/tip/b8922125e4790fa237a8a4204562ecf457ef54bb
Author:     Xunlei Pang <[email protected]>
AuthorDate: Sat, 9 Jul 2016 15:54:22 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 10 Aug 2016 13:32:55 +0200

sched/fair: Fix typo in sync_throttle()

We should update cfs_rq->throttled_clock_task, not pcfs_rq->throttle_clock_task.

The effects of this bug was probably occasionally erratic group scheduling, particularly in cgroups-intense workloads.

[ Added changelog. ]
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes 55e16d30bd99 ("sched/fair: Rework throttle_count sync")
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 4088eed..039de34 100644
@@ -4269,7 +4269,7 @@ static void sync_throttle(struct task_group *tg, int cpu)
 	pcfs_rq = tg->parent->cfs_rq[cpu];
 
 	cfs_rq->throttle_count = pcfs_rq->throttle_count;
-	pcfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
+	cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
 }
 
 /* conditionally throttle active cfs_rq's from put_prev_entity() */