Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153867 - >=cpufreqd-2.1.1 100% CPU usage
Summary: >=cpufreqd-2.1.1 100% CPU usage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Christian Heim (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-02 14:21 UTC by Renato Alves
Modified: 2006-11-05 05:03 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Renato Alves 2006-11-02 14:21:34 UTC
This is a weird issue but I haven't noticed it before, i.e. with previous cpufreqd. With this version the laptop CPU goes 100% a 2 seconds after closing the lid.

Currently the when the Lid is closed the hardware generates about 2 events per second. So basically it's kinda like flooding acpid.
In this situation, at start kacpid module goes from 10% to 30% while the lid button is pressed and quickly down after releasing the button.
After releasing the lid button acpid goes to 3% and stays there until the events stop (checked the log for that) and cpufreqd goes to 33% but the total CPU is at 100%.
After acpid stops logging cpufreqd stops too and CPU goes back to 1%~3%.

cpufreqd uses pmu acpi
acpid uses logrotate

This problem was noticed with cpufreqd-2.1.1. Latest cpufreqd (2.2.0-r2) has the same issues. 2.1.0 was not tested, and 2.0.0 works fine.
With cpufreqd-2.0.0, even when the lid is closed, the CPU is never above 7%.

PS: Also logging all the events can cause huge logs, 8 hours with the lid closed generated an 800Mb log. But that's another story... If anyone knows a way to prevent these huge logs besides logrotate I would appreciate the tip.
Comment 1 Mattia Dongili 2006-11-03 02:13:49 UTC
Hello,
I suppose an easy workaround would be to disable cpufreqd ACPI events processing by setting a bogus path in the [acpi] section just after the [General] one:

[acpi]
acpid_socket=/some/nonexistent/path
[/acpi]

BTW: cpufreqd should spit some error in the logs or stderr if started with -D

Can you test it?

Thanks
Mattia
Comment 2 Renato Alves 2006-11-03 07:44:38 UTC
Ok did a little testing.

1st try was to disable the acpi flag, but that disables the whole acpi system so without any flag cpufreqd does not give the 100% CPU but also doesn't react to acpi events such as AC plug, battery and temperature events.

with the suggested -D it shows:
init_configuration       : Unknown [acpi]: nobody handles it.
(...)
parse_config_rule        : WARNING! skipping config option "acpi_temperature"

which is obvious.

I noticed that the default cpufreqd behavior is to connect to the acpid.socket. I had the acpi socket part commented and still the cpu overuse happened.

By using the suggested setting problem was solved:

cpufreqd -D
acpi_event_init          : Couldn't connect to acpid socket /nowhere/acpid.socket (No such file or directory).

This way it no longer abuses cpu and still reacts to AC plug, battery and temperature events. (I only tested AC and battery, but I assume that temperature works fine too).

I would suggest disabling by default the acpid.socket and only enable it if defined in the conf. Either that or some sort of "flood" prevention measures.

acpid deals with this flooding by delaying the reaction time. Sometimes I open the lid and acpid keeps processing the events for quite a long time (depending on the number of events generated meanwhile) even if I no longer have the lid closed. This might not be the right approach cause if I define an action in acpid that reacts to the lid event, well you see the picture...

Thanks for you suggestion it solves the problem.
I hope you can solve this nasty bug in the next release.
Cheers

PS: I believe this bug is fixed for now.
Comment 3 Piotr Jaroszyński (RETIRED) gentoo-dev 2006-11-05 04:38:05 UTC
Please inform upstream. I can't reproduce that, but my laptop with closed lid isn't producing events every 2 secs, just once...
Comment 4 Mattia Dongili 2006-11-05 05:03:30 UTC
I'm cc-ed to the bug, thanks :)