Linux Power Management development
 help / color / mirror / Atom feed
* I think there's an issue with e3f1164fc9e ("PM: EM: Support late CPUs booting and capacity adjustment") if there's "holes" in your CPU topology
@ 2025-08-22  5:53 Kenneth Crudup
  2025-08-28 14:56 ` Christian Loehle
  0 siblings, 1 reply; 14+ messages in thread
From: Kenneth Crudup @ 2025-08-22  5:53 UTC (permalink / raw)
  To: lukasz.luba, linux-pm@vger.kernel.org, Rafael J. Wysocki


So I'm testing the "Energy Model" CPU scheduler, which means I need to 
set "nosmt"; this means I've got "holes" in my CPUs:

----
$  ls /dev/cpu | sort -n
0
2
4
6
8
10
12
13
14
15
16
17
18
19
----

So in .../kernel/power/energy_model.c , when this line gets to a CPU 
"hole", it throws an error and breaks out of the loop:

----
	   policy = cpufreq_cpu_get(cpu);
            if (!policy) {
                        pr_debug("Accessing cpu%d policy failed\n", cpu);
                        schedule_delayed_work(&em_update_work,
                                               msecs_to_jiffies(1000));
                        break;
            }
----

... but I'm thinking (and its working here for me) that a simple 
"continue" for those three lines handles the "CPU hole" case:

----
diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index ea7995a25780..df6cae6f8845 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -795,12 +795,9 @@ static void em_check_capacity_update(void)
                         continue;

                 policy = cpufreq_cpu_get(cpu);
-               if (!policy) {
-                       pr_debug("Accessing cpu%d policy failed\n", cpu);
-                       schedule_delayed_work(&em_update_work,
-                                             msecs_to_jiffies(1000));
-                       break;
-               }
+               if (!policy)
+                       continue;
+
                 cpufreq_cpu_put(policy);

                 dev = get_cpu_device(cpu);
----

Thoughts?

-Kenny

-- 
Kenneth R. Crudup / Sr. SW Engineer, Scott County Consulting, Orange 
County CA


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-09-04 21:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22  5:53 I think there's an issue with e3f1164fc9e ("PM: EM: Support late CPUs booting and capacity adjustment") if there's "holes" in your CPU topology Kenneth Crudup
2025-08-28 14:56 ` Christian Loehle
2025-08-28 17:42   ` Kenneth Crudup
2025-08-29 10:31     ` Christian Loehle
2025-08-29 16:45       ` Rafael J. Wysocki
2025-09-03 17:19       ` Kenneth Crudup
2025-09-03 17:26         ` Christian Loehle
2025-09-03 18:39           ` Kenneth Crudup
2025-09-03 18:40             ` Rafael J. Wysocki
2025-09-03 18:43               ` Kenneth Crudup
2025-09-03 18:53                 ` Rafael J. Wysocki
2025-09-04 17:40                   ` Rafael J. Wysocki
2025-09-04 18:27                     ` Kenneth Crudup
2025-09-04 21:14                     ` Kenneth Crudup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox