Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot put CPU0 offline?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Xoores
n00b
n00b


Joined: 15 Feb 2022
Posts: 5
Location: EU

PostPosted: Tue Aug 13, 2024 11:14 am    Post subject: Cannot put CPU0 offline? Reply with quote

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
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 121

PostPosted: Thu Aug 22, 2024 2:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22618

PostPosted: Thu Aug 22, 2024 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5929

PostPosted: Fri Aug 23, 2024 6:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Xoores
n00b
n00b


Joined: 15 Feb 2022
Posts: 5
Location: EU

PostPosted: Mon Aug 26, 2024 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22618

PostPosted: Mon Aug 26, 2024 9:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Xoores
n00b
n00b


Joined: 15 Feb 2022
Posts: 5
Location: EU

PostPosted: Mon Aug 26, 2024 9:41 pm    Post subject: Reply with quote

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 :D
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5929

PostPosted: Fri Sep 06, 2024 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Xoores
n00b
n00b


Joined: 15 Feb 2022
Posts: 5
Location: EU

PostPosted: Fri Sep 06, 2024 3:20 pm    Post subject: Reply with quote

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 :evil:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum