Skip to contentSkip to conversation

is_core_idle() is using a wrong variable

PATCH Applied [email protected] 5 participants 5 messages Jul 22, 2021 – Aug 5, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 is_core_idle() is using a wrong variable

From: Mika Penttilä <[email protected]>

is_core_idle() was using a wrong variable in the loop test. Fix it.

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 44c452072a1b..30a6984a58f7 100644
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
 		if (cpu == sibling)
 			continue;
 
-		if (!idle_cpu(cpu))
+		if (!idle_cpu(sibling))
 			return false;
 	}
 #endif
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 5 lines · On Thu, Jul 22, 2021 at 09:39:46AM +0300, [email protected] wrote:

From: Mika Penttilä <[email protected]>

is_core_idle() was using a wrong variable in the loop test. Fix it.

Thanks!

---
Subject: sched/numa: Fix is_core_idle()
From: Mika Penttilä <[email protected]>
Date: Thu, 22 Jul 2021 09:39:46 +0300

From: Mika Penttilä <[email protected]>

Use the loop variable instead of the function argument to test the other SMT siblings for idle.

Fixes ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
 		if (cpu == sibling)
 			continue;
 
-		if (!idle_cpu(cpu))
+		if (!idle_cpu(sibling))
 			return false;
 	}
 #endif
Acked-by
#2 lore raw
Quoted 16 lines · Peter Zijlstra
Quoted 5 lines · On Thu, Jul 22, 2021 at 09:39:46AM +0300, [email protected] wrote:

From: Mika Penttilä <[email protected]>

is_core_idle() was using a wrong variable in the loop test. Fix it.

Thanks!

---
Subject: sched/numa: Fix is_core_idle()
From: Mika Penttilä <[email protected]>
Date: Thu, 22 Jul 2021 09:39:46 +0300

From: Mika Penttilä <[email protected]>

Quoted 7 lines

Use the loop variable instead of the function argument to test the other SMT siblings for idle.

Fixes ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
Signature · 2 lines
Mel Gorman
SUSE Labs
Acked-by
#3 lore raw
In reply to Peter Zijlstra
Quoted 31 lines · Peter Zijlstra
Quoted 5 lines · On Thu, Jul 22, 2021 at 09:39:46AM +0300, [email protected] wrote:

From: Mika Penttilä <[email protected]>

is_core_idle() was using a wrong variable in the loop test. Fix it.

Thanks!

---
Subject: sched/numa: Fix is_core_idle()
From: Mika Penttilä <[email protected]>
Date: Thu, 22 Jul 2021 09:39:46 +0300

From: Mika Penttilä <[email protected]>

Use the loop variable instead of the function argument to test the other SMT siblings for idle.

Fixes ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

kernel/sched/fair.c static inline bool is_core_idle(int cpu) · line 1492

Quoted 8 lines
kernel/sched/fair.c +1 -1
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
                if (cpu == sibling)
                        continue;
 
-               if (!idle_cpu(cpu))
+               if (!idle_cpu(sibling))
                        return false;
        }
 #endif
merge bot Applied
#4 lore raw

[tip: sched/core] sched/numa: Fix is_core_idle()

In reply to [email protected]
The following commit has been merged into the sched/core branch of tip:

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     1c6829cfd3d5124b125e6df41158665aea413b35
Gitweb:        https://git.kernel.org/tip/1c6829cfd3d5124b125e6df41158665aea413b35
Author:        Mika Penttilä <[email protected]>
AuthorDate:    Thu, 22 Jul 2021 09:39:46 +03:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Wed, 04 Aug 2021 15:16:43 +02:00

sched/numa: Fix is_core_idle()

Use the loop variable instead of the function argument to test the other SMT siblings for idle.

Fixes ff7db0bf24db ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 11d2294..13c3fd4 100644
@@ -1486,7 +1486,7 @@ static inline bool is_core_idle(int cpu)
 		if (cpu == sibling)
 			continue;
 
-		if (!idle_cpu(cpu))
+		if (!idle_cpu(sibling))
 			return false;
 	}
 #endif