New: /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
https://bugzilla.kernel.org/show_bug.cgi?id=219332
Bug ID: 219332
Summary: /sys/devices/system/cpu/cpufreq/policy0/energy_perform
ance_preference: Device or resource busy
Product: Power Management
Version: 2.5
Hardware: AMD
OS: Linux
Status: NEW
Severity: high
Priority: P3
Component: cpufreq
Assignee: [email protected]
Reporter: [email protected]
Regression: No
Created attachment 306935
--> https://bugzilla.kernel.org/attachment.cgi?id=306935&action=edit
A dump of /sys/devices/system/cpu
I've played with various tee: /sys/devices/system/cpu/cpufreq/policy0/* options and now on Linux 6.11 and Ryzen 7 5800X I'm getting this:
perfbias.sh power
Now: performance
Switching to: power
tee: /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference:
Device or resource busy
tee: /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference:
Device or resource busy
Result: performance
This doesn't seem right.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #1 from Artem S. Tashkinov ([email protected]) --- Created attachment 306936
--> https://bugzilla.kernel.org/attachment.cgi?id=306936&action=editperfbias.sh
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #2 from Artem S. Tashkinov ([email protected]) ---
What I also do NOT like at all, is that in Linux 6.11 amd-pstate gets loaded by default and there is no information about that in dmesg.
Please kprint() that amd-pstate has been loaded and is active.
Thank you.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #3 from Artem S. Tashkinov ([email protected]) --- Lastly,
https://docs.kernel.org/admin-guide/pm/amd-pstate.html
Doesn't specify how the driver can be completely disabled.
I'm now using initcall_blacklist=amd_pstate_init amd_pstate.enable=0 but I'm not sure if that's correct.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #4 from Mario Limonciello (AMD) ([email protected]) ---
[laugh] Limonciello, Mario reacted to your message:
________________________________
From: [email protected] <[email protected]>
Sent: Sunday, September 29, 2024 1:50:50 PM
To: Limonciello, Mario <[email protected]>
Subject: [Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #3 from Artem S. Tashkinov ([email protected]) --- Lastly,
https://docs.kernel.org/admin-guide/pm/amd-pstate.html
Doesn't specify how the driver can be completely disabled.
I'm now using initcall_blacklist=amd_pstate_init amd_pstate.enable=0 but I'm not sure if that's correct.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are on the CC list for the bug.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #5 from Mario Limonciello (AMD) ([email protected]) --- Can you please provide a kernel log with dynamic debugging turned on for drivers/cpufreq/amd-pstate.c so I can understand what it is doing with your hardware?
Just a guess with no messages but it's very possible that because 6.11 doesn't have c3e093efbc6cac7bf9dc531dcb751b86daaa65b0 an error is being masked.
Perhaps you can try to add that commit and see if it changes?
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
Dhananjay Ugwekar (AMD) ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #6 from Dhananjay Ugwekar (AMD) ([email protected]) --- (In reply to Artem S. Tashkinov from comment #0)
Quoted 43 lines
Created attachment 306935 [details]
A dump of/sys/devices/system/cpuI've played with various tee:
/sys/devices/system/cpu/cpufreq/policy0/*options and now on Linux 6.11 and Ryzen 7 5800X I'm getting this:
perfbias.shpower
Now: performance
Switching to: power
tee:/sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference:
Device or resource busy
tee:/sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference:
Device or resource busy
Result: performance
Quoted 1 line
This doesn't seem right.
I see from the attachment that you are using performance governor, so you are limited to only performance EPP hint, trying to write other EPP hints (power/balance_power/balance_performance) will show the above error.
You'll need to change to powersave governor to use these hints. Please let me know if this fixes your issue.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #7 from Artem S. Tashkinov ([email protected]) --- (In reply to Dhananjay Ugwekar (AMD) from comment #6)
Quoted 7 lines
I see from the attachment that you are using performance governor, so you are limited to only performance EPP hint, trying to write other EPP hints (power/balance_power/balance_performance) will show the above error.
You'll need to change to powersave governor to use these hints. Please let me know if this fixes your issue.
That's indeed the case and changing the CPU frequency governor to "powersave" has fixed the issue but I wonder if you could log an error message in dmesg if the governor is incompatible with what the user has requested.
It still makes my head hurt trying to understand the interaction between classic CPU governors and energy_performance_preference modes.
From the testing I've done it looks like classic CPU governors are 100% useless/have zero effect in the presence of amd-pstate in which case I don't understand why they are exposed/exist in the first place. Is it possible to hide them? Make them read only? Just to avoid further useless bug reports.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #8 from Dhananjay Ugwekar (AMD) ([email protected]) --- (In reply to Artem S. Tashkinov from comment #7)
Quoted 6 lines
(In reply to Dhananjay Ugwekar (AMD) from comment #6)
Quoted 5 lines
I see from the attachment that you are using performance governor, so you are limited to only performance EPP hint, trying to write other EPP hints (power/balance_power/balance_performance) will show the above error.
Quoted 7 lines
Quoted 2 lines
You'll need to change to powersave governor to use these hints. Please let me know if this fixes your issue.
That's indeed the case and changing the CPU frequency governor to "powersave" has fixed the issue but I wonder if you could log an error message in dmesg if the governor is incompatible with what the user has requested.
Right, this will be helpful, will put out a patch for this. Also there is an "energy_performance_available_preferences" file which shows the allowed EPP hints that can be written to the "energy_performance_preference" sysfs file, you could incorporate that into your shell script.
Quoted 6 lines
It still makes my head hurt trying to understand the interaction between classic CPU governors and
energy_performance_preferencemodes.From the testing I've done it looks like classic CPU governors are 100% useless/have zero effect in the presence of amd-pstate
I guess you are using amd_pstate=active, in which only performance and powersave governors are supported and the decision making is mostly in the hands of platform firmware.
However, if you use amd_pstate=passive mode, the OS governors (schedutil, conservative, etc) are responsible for making the frequency decisions.
in which case I don't
Quoted 1 line
understand why they are exposed/exist in the first place.
Didnt understand this part, in which scenario were you able to see the governors, but they were ineffective?
Is it possible to
Quoted 1 line
hide them? Make them read only? Just to avoid further useless bug reports.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #9 from Mario Limonciello (AMD) ([email protected]) ---
Quoted 2 lines
Didnt understand this part, in which scenario were you able to see the governors, but they were ineffective?
I'm confused by this too.
$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver amd-pstate-epp $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors performance powersave $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor powersave
I don't see any others exposed in active mode.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
Artem S. Tashkinov ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |ANSWERED--- Comment #10 from Artem S. Tashkinov ([email protected]) ---
When amd-pstate=active whatever is written to /sys/devices/system/cpu/cpufreq/policy0/scaling_governor has zero effect on the CPU behavior/system thermals. That's what I was trying to say.
I wonder if amd-pstate could "simply" hide/disable (i.e. make read-only) scaling_available_governors AND scaling_governor.
It looks like these two "variables" are remnants of acpi-cpufreq and should _not_ be exposed when amd-pstate is active.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.
[Bug 219332] /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference: Device or resource busy
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=219332
--- Comment #11 from Mario Limonciello (AMD) ([email protected]) ---
Quoted 3 lines
When
amd-pstate=activewhatever is written to/sys/devices/system/cpu/cpufreq/policy0/scaling_governorhas zero effect on the CPU behavior/system thermals. That's what I was trying to say.
I wouldn't say zero effect - it definitely can matter. If you start out in powersave at a more efficiency biased EPP value then switching to performance is going to increase power consumption and heat etc.
Quoted 2 lines
I wonder if amd-pstate could "simply" hide/disable (i.e. make read-only)
scaling_available_governorsANDscaling_governor.
Userspace can still change the cpufreq governor from performance to powersave and vice versa. So it should not go away.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are the assignee for the bug.