Saturday, January 2, 2010

Infostructure Notes: An E-meter for Intel Hell?

Unhappy macunaimachine

Insane macunaimachine

Happy Macunaimachine

Sane macunaimachine

Some shoot heroin, fish, knit or bowl.

When I am feeling fidgety and lacking in outlets for my nervous energy, I start doing things to my Linux machine that tend to break it, then spend days rummaging through user forums in search of ways to unbreak it.

In this case, however, what seems to have broken my beloved macunaimachine was upgrading the kernel to Ubuntu Linux 2.6.17-generic.

With this upgrade, I have problems with adjusting the frequency of my CPU that I never had before.

Intense googling, vast, intuitive leaps of fuzzy poetry-major logic, and the filing of my very first Ubuntu bug report — I am kind of proud of that — have led me to the conclusion that there must some daemon, as yet unknown to me, that turns on 15 minutes or so after boot and takes command, issuing insane instructions to the cpufreq interface.

Result: random system overloads that come and go at seemingly unpredictable times (above).

As I was saying to my better half, this hypothetical misbehaving daemon is sort of like a body thetan in the cosmology of Scientology.

(I recently translated a Wikipedia gist of that cosmology into Portuguese, just for the hell of it, and the practice. Warning: If you obtain that knowledge without paying for it, you will contract pneumonia, according to the Church of Scientology.)

One thing I know for certain is that the kernel developers have now compiled support for various CPUs directly into the new kernel version, whereas previously they were loaded as modules. My CPU, for example –

processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 14 model name : Genuine Intel(R) CPU T2500 @ 2.00GH stepping : 8

(and the same for processor 1, since the T2500 is dual-core) — used to run with a module called speedstep-centrino. Now, however, a subroutine in the acipd daemon, acpi-cpufreq, is supposed to take over those tasks.

(There is advice floating around in the forums for recreating and loading, or compiling in, a module for this deprecated driver, but to date I have not had the guts to try it.)

Here is what happens.

I boot up, alt-F2, gnome-terminal, sudo cpufreq-info on the command line, and I get the good news in eloquent techno-Brazilian:

Good news for modern Linux-monkeys

It says that my CPU is set up to run at 1.0 GHz, 1.33Ghz, 1.67GHz, or 2.0GHz.

(I don’t know what “stepping: 8″ in my cat proc/cpuinfo output means. Is it supposed to have 8 steps, or is it the four steps, multiplied by the two cores?)

A CPU governor called ondemand — the default, according to the Ubuntu and other Linux forums (this problem is not unique to Ubuntu, but seems to affect all flavors of the 2.6.x kernel) — is set up to take the foot off the gas when the workload is light, or put the pedal to the medal when the going gets tough.

These settings are native to the processor, and are read, I guess by acpid. (Or does hald have something to say about it?)

At this point, I am a happy camper.

Some time later, however, GKrellM System Monitor screams that both cores are maxed out, and the machine grows terribly sluggish — just like Macunaima, whose motto is “ai, que preguiça!” (Boy, do I feel lazy!

Ai, que preguiça!)

Now I am terribly unhappy.

I start installing and removing the various third-party CPU governors — cpufreqd, powernowd, cpudyn, and (and what does this do, anyway?) Gnome Power Manager — one by one, to see if this makes a difference.

Not that I can tell.

O e-meter das Cientologistas

Once I have used my E-meter (above) to “clear” the machine of CPU daemons (“body thetans”), as well as these i8k tools for Dell laptops — not much use, as far as I could tell, but maybe I should try them again after reading the manual more thoroughly — I start messing around with cpufrequtils and sysfsutils.

In some forums, they say this is all you really need to play nice with acpi-cpufreq.

(But then again, various people say various things.)

Sometimes it seems as though a good cpufreq-set -c 0 -g performance and cpufreq-set -c 1 -g performance, perhaps followed by a cpufreq-set -c 0 -f 2000000, rejiggers things.

Then again, at other times, those settings do not take, according to cpufreq-info.

And at other times, the system seems to reset itself, behaving nicely, even though cpufreq-info tells me, absurdly:

política atual: a frequência deveria estar entre 1000 MHz e 1000 MHz. O governor "performance" deve decidir qual velocidade usar dentro desse limite.

It says the performance governor is free to reset the frequency between the limits of 1.0 GHz and 1.0 GHz.

Some freedom.

Conclusion: cpufreq-info is about as reliable a source of information as Veja magazine or Dick Cheney and Condi Rice’s joint blog, “The Daily Mushroom Cloud.”

Result: I am more confused about who or what is setting this policy than a Brazilian gubernatorial administration. And I insist on being the bearded, cigar-chomping absolute dictator of my own man-machine interface.

So what now?

In the meantime, a quick reboot puts things back in working order for a while, but I really miss being able to run resource-intensive toys like OpenLife and such, and the kind of frenzied multitasking I am known for.

Now is the time, I guess, to really learn how to parse log files. There are these lines from dmesg, for example:

[ 0.651155] ACPI: CPU1 (power states: C1[C1] C2[C2] C3[C3])

[ 0.651348] processor LNXCPU:01: registered as cooling_device1

[ 0.651400] ACPI: Processor [CPU1] (supports 8 throttling states)

[ 0.674904] thermal LNXTHERM:01: registered as thermal_zone0

[ 0.674961] ACPI: Thermal Zone [THM] (25 C)

Could that be part of my problem?

My CPU tends to run normally and safely between 50°C and 75°C.

(Also, ACPI is recognizing my Duo 2 processor as one processor [CPU01] here. Does it know there are two virtual processors available? Output from the system monitor does show the two cores acting independently.)

And later:

[ 1.063592] cpuidle: using governor ladder

[ 1.063766] cpuidle: using governor menu

But this is all Greek to me. So I guess this is the next thing to start googling up.

As Prof. Lehrer used to sing:

These are all the elements

That are known to Harvard

There may be many others

But they haven’t been discarvard …

It is very important for your character-formation to spend time trying to learn to do things you are very likely to suck at, I believe.

[Via http://tupiwire.wordpress.com]

No comments:

Post a Comment