Hello Raspberry Pi Community,
I’m currently working on a project with the Raspberry Pi 4 Model B, and I’m exploring ways to optimize its power consumption. Specifically, I’m experimenting with disabling cores to save energy during light tasks. However, I’ve encountered a challenge:
If I disable some cores (e.g., Core 1, Core 2, and Core 3) and later run a heavy task that a single core (Core 0) cannot handle, the system slows down drastically or even crashes because the disabled cores don’t automatically enable themselves.
This brings me to my question:
Is there a way to dynamically enable and disable Raspberry Pi cores based on the system's workload?
For example, if the CPU load increases beyond what a single core can handle, the system would automatically enable additional cores to handle the workload, and when the load decreases, it would disable the unused cores to save power.
I’m aware of the following:
Disabling/enabling cores can be done manually via /sys/devices/system/cpu/cpuX/online.
CPU frequency governors like ondemand or schedutil can dynamically adjust the CPU frequency, but they don’t enable/disable cores.
Writing a custom script to monitor CPU load and toggle cores could be a solution, but I’m wondering if there’s already an existing tool or kernel feature for this.
Key Questions:
Is there a built-in Linux mechanism or Raspberry Pi-specific feature for dynamic core management?
If this is achievable via custom scripting, what are the potential drawbacks (e.g., latency, kernel-level issues)?
Are there any pros and cons to enabling/disabling cores dynamically compared to just relying on CPU governors for frequency scaling?
I would love to hear your insights, experiences, or suggestions on this topic. If anyone has tried something similar or knows about a better approach, please share your thoughts!
Thank you in advance for your help.
Best regards,
Anis
I’m currently working on a project with the Raspberry Pi 4 Model B, and I’m exploring ways to optimize its power consumption. Specifically, I’m experimenting with disabling cores to save energy during light tasks. However, I’ve encountered a challenge:
If I disable some cores (e.g., Core 1, Core 2, and Core 3) and later run a heavy task that a single core (Core 0) cannot handle, the system slows down drastically or even crashes because the disabled cores don’t automatically enable themselves.
This brings me to my question:
Is there a way to dynamically enable and disable Raspberry Pi cores based on the system's workload?
For example, if the CPU load increases beyond what a single core can handle, the system would automatically enable additional cores to handle the workload, and when the load decreases, it would disable the unused cores to save power.
I’m aware of the following:
Disabling/enabling cores can be done manually via /sys/devices/system/cpu/cpuX/online.
CPU frequency governors like ondemand or schedutil can dynamically adjust the CPU frequency, but they don’t enable/disable cores.
Writing a custom script to monitor CPU load and toggle cores could be a solution, but I’m wondering if there’s already an existing tool or kernel feature for this.
Key Questions:
Is there a built-in Linux mechanism or Raspberry Pi-specific feature for dynamic core management?
If this is achievable via custom scripting, what are the potential drawbacks (e.g., latency, kernel-level issues)?
Are there any pros and cons to enabling/disabling cores dynamically compared to just relying on CPU governors for frequency scaling?
I would love to hear your insights, experiences, or suggestions on this topic. If anyone has tried something similar or knows about a better approach, please share your thoughts!
Thank you in advance for your help.
Best regards,
Anis
Statistics: Posted by anis_ghabarou — Mon Jan 27, 2025 7:46 pm — Replies 2 — Views 70