cpuidle: coupled: fix ready counter decrement
PATCH 1/1 cpuidle: coupled: fix ready counter decrement
The ready_waiting_counts atomic variable is compared against the wrong online cpu count. The latter is computed incorrectly using logical-OR instead of bit-OR. This patch fixes that.
--- drivers/cpuidle/coupled.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/coupled.c +1 -1
@@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)int all;int ret; - all = coupled->online_count || (coupled->online_count <<WAITING_BITS ); + all = coupled->online_count | (coupled->online_count <<WAITING_BITS ); ret =atomic_add_unless (&coupled->ready_waiting_counts, -MAX_WAITING_CPUS , all);
Signature · 1 line
1.7.9.5
Quoted 3 lines · Sivaram Nair
The
ready_waiting_countsatomic variable is compared against the wrong online cpu count. The latter is computed incorrectly using logical-OR instead of bit-OR. This patch fixes that.
I'm queuing this up for submission as v3.8 material.
I suppose it should be marked for -stable too?
Rafael
Quoted 19 lines
Signed-off-by Sivaram Nair <[email protected]>--- drivers/cpuidle/coupled.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpuidle/coupled.c +1
-1@@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)int all;int ret; - all = coupled->online_count || (coupled->online_count <<WAITING_BITS ); + all = coupled->online_count | (coupled->online_count <<WAITING_BITS ); ret =atomic_add_unless (&coupled->ready_waiting_counts, -MAX_WAITING_CPUS , all);
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Colin Cross
Acked-byQuoted 10 lines · Rafael J. Wysocki
Quoted 3 lines · Sivaram Nair
The
ready_waiting_countsatomic variable is compared against the wrong online cpu count. The latter is computed incorrectly using logical-OR instead of bit-OR. This patch fixes that.I'm queuing this up for submission as v3.8 material.
I suppose it should be marked for -stable too?
Rafael
Looks suitable for stable.
Quoted 22 lines
Quoted 11 lines
Signed-off-by Sivaram Nair <[email protected]>--- drivers/cpuidle/coupled.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpuidle/coupled.c +0
-0drivers/cpuidle/coupled.c inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled) · line 215
Quoted 8 lines
drivers/cpuidle/coupled.c +1
-1@@ -209,7 +209,7 @@ inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled)int all;int ret; - all = coupled->online_count || (coupled->online_count <<WAITING_BITS ); + all = coupled->online_count | (coupled->online_count <<WAITING_BITS ); ret =atomic_add_unless (&coupled->ready_waiting_counts, -MAX_WAITING_CPUS , all);--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Quoted 6 lines · Sivaram Nair
The
ready_waiting_countsatomic variable is compared against the wrong online cpu count. The latter is computed incorrectly using logical-OR instead of bit-OR. This patch fixes that.Signed-off-by Sivaram Nair <[email protected]>---
Looks right.