Saturday, March 3, 2012

Power management in SPARC & Solaris

Few days ago someone asked me in the comments to the How-To post, whether there is a way to reduce CPU consumption of the qemu-system-sparc. I assumed qemu lacks some device necessary for the power management. So, if we implement it, qemu-system-sparc won't take 100% of CPU all the time.

And then after looking at the qemu source I was really surprised: qemu does emulate the 'power-management' device. The reason why Solaris consumes so much CPU is Solaris itself! It's just doesn't have a driver for the 'power-management' device on SPARCStation-5. In all 'prtconf' outputs I could google out, there is a line:

power-management (driver not attached)

And then comes a bigger surprise: Linux perfectly supports CPU power management on SPARCStation-5. Even under qemu: after Debian/SPARC is booted, 'top' shows that qemu-system-sparc takes only 3% of a host  CPU.
 
How came that Sun didn't support CPU power management on their own sun4m machines?

P.S. By the way, NetBSD supports CPU power management too.

8 comments:

leonid said...

Забавненько. Энтерпрайз на такие штуки тогда не обращал внимание что-ли?

Anonymous said...

can you help us to earn low cpu utilization with qemu/sparc ... I'm using debian 6.0 and qemu 1.0.1. I've installed netbsd/sparc and the cpu with SS5 and my main os has max cpu util. under boot session:

"power-management at sbus0 slot 4 offset 0xa000000 not configured"

how do we fix it?
thanks

atar said...

What NetBSD version are you using? Does it have the "apc" driver? The driver was obviously added to CVS at Jan 15 20:57:13 UTC 2010. If your release is older than this, you definitely don't have it.

Otherwise, have you looked at the link I gave in the original post? There is a hint in the documentation: "Not enabled by default because it can cause some Sparc systems to hang (so says the linux driver)".

I guess you'll have to reconfigure/recompile the kernel.

Anonymous said...

thanks for fast reply, the system is the newest one :) 5.1.2
Yes,I've read the entire, but I didn't find any references to kernel recompile. So can you describe shortly what was the "key" in kernel modules, what do we need to get apc module?
sorry, I know, I'm newbie in unix's world :)

atar said...

http://www.netbsd.org/docs/guide/en/chap-kernel.html

Also you can try asking at port-sparc@netbsd.org whether someone can share a kernel with apc compiled in.

Unix newbie starting with NetBSD is pretty hardcore. :-)

Anonymous said...

Ok, I find that page ... but xDDD as you said, little bit hardcore for me. But, please confirm me! It is absolutely possible to solve this cpu utilization issue with an recompiled kernel with appropriate apc module? If yes, I only need to understand the methods and It will work, Am I right? :)

Or something else I have to do?
regards, Dome

atar said...

I didn't test NetBSD power-management myself, only the Linux one. But since the driver looks pretty much the same as the Linux one, this must be it. Ask port-sparc@netbsd.org for the ultimate answer.

atar said...

@leonid - возможно дело в проблемах со стабильностью. Комментарий в линуксном драйвере говорит, что некоторые машинки виснут при включеном power-management. Но вообще всё это выглядит странно.

Посмотрел исходники OpenSolaris - похоже, что выключать процессор когда он не используется, Solaris научилась не так давно - уже только при sun4v. Трудно в это поверить, но для других машин я этого в коде не нахожу.