View previous topic :: View next topic |
Author |
Message |
Xoores n00b
Joined: 15 Feb 2022 Posts: 5 Location: EU
|
Posted: Tue Aug 13, 2024 11:14 am Post subject: Cannot put CPU0 offline? |
|
|
Hi,
I'm trying to get CPU hotplug working on i9 CPU - and it works for all cpus (threads) but CPU0. I know that hotplug for CPU0 has to be enabled separately by adding `cpu0_hotplug` or setting a config option in a kernel config (kernel.org doc).
However on 6.10.0-gentoo this option does not seem to exist and that cmdline option does nothing.
What am I doing wrong?
Thanks |
|
Back to top |
|
|
myga Tux's lil' helper
Joined: 12 Jun 2023 Posts: 121
|
Posted: Thu Aug 22, 2024 2:20 am Post subject: |
|
|
Are you using sys-kernel/gentoo-sources? How are you searching for that option? _________________ [Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.] |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22648
|
Posted: Thu Aug 22, 2024 11:38 am Post subject: |
|
|
This was (mostly) removed in x86/topology: Remove CPU0 hotplug option (v6.4-rc2-5-ge59e74dc48a3). I see a few documentation remnants, but the Kconfig option for setting a default, and the code for reacting to it, are gone. As such, it seems like a documentation bug that you can still find current documentation that describes it. |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5929
|
Posted: Fri Aug 23, 2024 6:21 pm Post subject: |
|
|
small question, if you offline cpu0, this means there is no bsp cpu and afaik, x64 doesn't support alternate bsps like aarch64 does.
how will your system work? _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
Xoores n00b
Joined: 15 Feb 2022 Posts: 5 Location: EU
|
Posted: Mon Aug 26, 2024 8:15 pm Post subject: |
|
|
myga wrote: | Are you using sys-kernel/gentoo-sources? How are you searching for that option? |
Yup. Using grep, Kconfig, ... But as Hu wrote, it may have just been removed...
Hu wrote: | This was (mostly) removed in x86/topology: Remove CPU0 hotplug option (v6.4-rc2-5-ge59e74dc48a3). I see a few documentation remnants, but the Kconfig option for setting a default, and the code for reacting to it, are gone. As such, it seems like a documentation bug that you can still find current documentation that describes it. |
Damn It is sad that we are finally getting P-cores and E-cores and it now actually makes sense to put CPU cores offline and Linux is removing this...
DaggyStyle wrote: | small question, if you offline cpu0, this means there is no bsp cpu and afaik, x64 doesn't support alternate bsps like aarch64 does.
how will your system work? |
If I understand BSP correctly, it is a CPU/cores that execute pre-boot environment such as UEFI etc. I don't want/need to put CPU0 to sleep before boot, so I don't think that I'm that worried about not having a BSP. I don't even want to put CPU0 offline, when the device goes to sleep. However I would like to put P-cores to sleep when running on battery & doing some work. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22648
|
Posted: Mon Aug 26, 2024 9:30 pm Post subject: |
|
|
As I read the justification for removal, the feature you want never really worked fully, so the code that pretended to support this was removed after 11 years of waiting for it to be finished. |
|
Back to top |
|
|
Xoores n00b
Joined: 15 Feb 2022 Posts: 5 Location: EU
|
Posted: Mon Aug 26, 2024 9:41 pm Post subject: |
|
|
Yeah, probably. I honestly hope that they will introduce some better way to handle P-/E-cores. Seems like this is a direction modern hardware is taking and it would be nice to have some direct in-kernel support for this kind of things.
I don't really think that blindly putting the cores offline is the best approach here because current implementation in kernel does not seem to be too happy as there is a detectable "hiccup" when changing core state. However this is the only way I found out to have atleast some way of taking advantage of having different core types at the moment (without having to code something).
I did not do any *exact* tests yet (since I could not put P-cores fully to sleep so far), but I'd say it makes a huge difference on my computer - disabling P-cores almost doubles my battery life. I'm still fighting with a new hardware so there are few things to be ironed out, but that's the price I have to pay |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5929
|
Posted: Fri Sep 06, 2024 7:48 am Post subject: |
|
|
Xoores wrote: | myga wrote: | Are you using sys-kernel/gentoo-sources? How are you searching for that option? |
Yup. Using grep, Kconfig, ... But as Hu wrote, it may have just been removed...
Hu wrote: | This was (mostly) removed in x86/topology: Remove CPU0 hotplug option (v6.4-rc2-5-ge59e74dc48a3). I see a few documentation remnants, but the Kconfig option for setting a default, and the code for reacting to it, are gone. As such, it seems like a documentation bug that you can still find current documentation that describes it. |
Damn It is sad that we are finally getting P-cores and E-cores and it now actually makes sense to put CPU cores offline and Linux is removing this...
DaggyStyle wrote: | small question, if you offline cpu0, this means there is no bsp cpu and afaik, x64 doesn't support alternate bsps like aarch64 does.
how will your system work? |
If I understand BSP correctly, it is a CPU/cores that execute pre-boot environment such as UEFI etc. I don't want/need to put CPU0 to sleep before boot, so I don't think that I'm that worried about not having a BSP. I don't even want to put CPU0 offline, when the device goes to sleep. However I would like to put P-cores to sleep when running on battery & doing some work. |
Code: | dagg@NCC-5001D ~ $ find /sys -name "online" | grep cpu
/sys/devices/system/cpu/cpu11/online
/sys/devices/system/cpu/cpu9/online
/sys/devices/system/cpu/cpu7/online
/sys/devices/system/cpu/cpu5/online
/sys/devices/system/cpu/cpu3/online
/sys/devices/system/cpu/online
/sys/devices/system/cpu/cpu14/online
/sys/devices/system/cpu/cpu1/online
/sys/devices/system/cpu/cpu12/online
/sys/devices/system/cpu/cpu10/online
/sys/devices/system/cpu/cpu8/online
/sys/devices/system/cpu/cpu6/online
/sys/devices/system/cpu/cpu4/online
/sys/devices/system/cpu/cpu15/online
/sys/devices/system/cpu/cpu2/online
/sys/devices/system/cpu/cpu13/online
|
usualy the bso is 0 or 15 (seen some AMD systems)
as you can see above, at least on my system, you cannot offline cpu0
I don't think linux allows bsp offline _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
Xoores n00b
Joined: 15 Feb 2022 Posts: 5 Location: EU
|
Posted: Fri Sep 06, 2024 3:20 pm Post subject: |
|
|
DaggyStyle wrote: |
usualy the bso is 0 or 15 (seen some AMD systems)
as you can see above, at least on my system, you cannot offline cpu0
I don't think linux allows bsp offline |
Yeah it seems like it - this unfortunately clashes with the modern systems that have CPU cores split into P- and E- cores. Hopefully linux catches up sooner than later. I don't think this is going to change, ARM uses this strategy as well and it can bring quite a huge powersaving benefits.
This is fortunately much better idea than introduction of that idiotic S0ix sleep |
|
Back to top |
|
|
|