cpu fun

While looking at options 2.6.18 provided, I came across cpu “hotplug”, where one can turn on/off CPUs on the fly. On my workstation(dual opteron 248) I enabled CONFIG_HOTPLUG_CPU and rebooted. A simple # echo 0 > /sys/devices/system/cpu/cpu1/online and /proc/cpuinfo only shows one processor. This showed up in dmesg:

CPU 1 is now offline
SMP alternatives: switching to UP code

After # echo 1 > /sys/devices/system/cpu/cpu1/online /proc/cpuinfo shows both CPUs and dmesg contains this:

SMP alternatives: switching to SMP code
Booting processor 1/2 APIC 0x1
Initializing CPU#1
Calibrating delay using timer specific routine.. 4410.23 BogoMIPS (lpj=22051180)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1/1 -> Node 0
AMD Opteron(tm) Processor 248 stepping 0a
CPU 1: Syncing TSC to CPU 0.
CPU 1: synchronized TSC with CPU 0 (last diff 2 cycles, maxerr 821 cycles)

This makes me wonder “how much” the CPU is shut down… I wonder if this could be used as some sort of power management for SMP systems.

Time to find a ammeter….

5 thoughts on “cpu fun”

  1. Have you been able to determine if shutting down a core with hotplug reduces power useage? I shut down one of the cores on my Optereon 165, but the core temperature did not drop (this was at idle).

  2. you can’t disable the first CPU(on my box) I don’t think disabling one core will have much effect on power consumption. the best way to find out is it get a wattmeter and have a good testcase(compile something big)

  3. Well, i checked energy consumption after disabling one of cpu’s. On my laptop (core 2 duo – t7200) it’s bigger than with both cores enabled ;/. I can’t also hear a beeping from my machine, which can be heared when cpus (both cores) are idle. It seems, that disabled core is consumig as much energy as it can. So imo disabling one of cpus is just for fun.

  4. The core is just marked as offline for the scheduler, which means it won’t be allocated any thread. But the CPU is not “physically” shutdown. On a dual quad-core setup, offlining 6 of the 8 cores reduces consumption by 5-6 W in idle…

Comments are closed.