WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to automatically use HOTPLUGGED CPUs  (Read 4579 times)

Offline code

  • Newbie
  • *
  • Posts: 22
How to automatically use HOTPLUGGED CPUs
« on: January 22, 2018, 03:45:32 PM »
I am using libvirt with Tiny Core guests. When I increase the number of CPUs the new CPUs are not automatically being used.

They show up in /sys/devices/system/cpu/ and I can start using them by doing

Code: [Select]
echo 1 > /sys/devices/system/cpu/cpu1/online





Offline code

  • Newbie
  • *
  • Posts: 22
Re: How to automatically use HOTPLUGGED CPUs
« Reply #1 on: January 24, 2018, 11:20:32 AM »
Okay I had to add a udevd rule  :)

Following this https://support.host1plus.com/index.php?/Knowledgebase/Article/View/1357/0/how-to-enable-memorycpu-hot-plugging-on-my-linux-server

I created

Code: [Select]
/etc/udev/rules.d/40-cpu-hotplug.rules
containing

Code: [Select]
# CPU hotadd request
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"

Is this something that can be added to Tiny Core?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: How to automatically use HOTPLUGGED CPUs
« Reply #2 on: January 24, 2018, 01:28:05 PM »
I think hotplugging cpus is fairly niche use, with most VM users setting the cpu count before starting?

You can either remaster the rule in, or include it in your backup and command udev to reload rules in bootlocal.sh.
The only barriers that can stop you are the ones you create yourself.