rickysarraf / laptop-mode-tools

Power Savings tool for Linux
https://www.researchut.com/tags/laptop-mode-tools/
GNU General Public License v2.0
556 stars 47 forks source link

lm_battery.sh executes for too long #138

Open l29ah opened 5 years ago

l29ah commented 5 years ago

ACPI produces battery events every 2s or so, while /etc/acpi/actions/lm_battery.sh can execute for about ten seconds, causing the other ACPI events to pile up and causing huge delays for things like udev permission setup for USB devices. Occurred to me on Thinkpad X201, X230 and X210 on Gentoo.

rickysarraf commented 5 years ago

This seriously is a problem with your machine. The events shouldn't generate that often.

As for laptop-mode-tools, yes, your run time could be a couple of seconds. On reasonable hardware, I have profiled it to the average of 5 seconds. But with low end hardware with slow disk drives, this could spike.

But, laptop-mode-tools does have locking in place which lets it honor only 1 additional event in its queue during its runtime. All other events are ignored/dropped. But as is your case (or 2 second events), it would still be like a stream of events.

This is still a problem with your hardware. A sane machine does not generate events that often. Can you share what class of events are generated ?

rickysarraf commented 5 years ago

Your best option is to purge acpi and rely on udev instead.

l29ah commented 5 years ago

battery PNP0C0A:03 00000080 00000001

l29ah commented 5 years ago

Now i'm on X210, i'm not really sure about the others as i can't test them now with enabled event logging.