You are not logged in.

#1 2012-11-25 12:10:13

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

systemd & laptop power

I'm looking for the simplest way to detect acpi events and configure cpu frequency governors under systemd. According to the laptop wiki page, systemd does not support power events (yet?). The article recommends using udev rules, but they do not seem to work. Can anyone confirm that they do?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2012-11-25 12:28:50

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: systemd & laptop power

not really answering your question, but I think you should read this. wink
http://mjg59.livejournal.com/88608.html

Some people write software that lets you choose different power profiles depending on whether you're on AC or battery. Typically, one of the choices lets you reduce the speed of your processor when you're on battery. This is bad. It is wrong. The people who implement these programs are dangerous. Do not listen to them. Do not endorse their product and/or newsletter. Do not allow your eldest child to engage in conjugal acts with them. Doing this will reduce your battery life. It will heat up your home. It will kill baby seals. The sea will rise and your car will float away. If you are already running it, make sure that it always sets your cpufreq governor to ondemand and does not limit the frequencies in use. Failure to do so will result in me setting you on fire[4].

Offline

#3 2012-11-26 13:38:44

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: systemd & laptop power

Do you have anything that isn't a baseless handwaving rant to back that up?

My only reason for slightly doubting it is that there is so much discussion about using different CPU frequency governors. Of course, most people can be dead-wrong about many things. wink


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2012-11-26 15:33:29

Vixus
Member
Registered: 2012-11-02
Posts: 60

Re: systemd & laptop power

Offline

#5 2012-11-26 16:07:36

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: systemd & laptop power

Xyne wrote:

Do you have anything that isn't a baseless handwaving rant to back that up?

My only reason for slightly doubting it is that there is so much discussion about using different CPU frequency governors. Of course, most people can be dead-wrong about many things. wink

yes, It reads kind like a rant, but he is a kernel dev, so I trust his judgement. wink
I would love to back this up with some kind of governor battery life / performance comparison, but this doesn't seem to exist. wink

Offline

#6 2012-11-26 16:21:56

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: systemd & laptop power

65kid wrote:

yes, It reads kind like a rant, but he is a kernel dev, so I trust his judgement. wink

Ah... well, ok, kernel devs have a higher hand-waving quota (same quota as physics professors).


65kid wrote:

I would love to back this up with some kind of governor battery life / performance comparison, but this doesn't seem to exist. wink

+1

Post links if you find anything.



@Vixus
Thanks, I'm aware of that thread. The last time that I looked it it was was a collection of very specific tweaks that would require some effort to manage. I'll take another look when I have time. For now I was hoping for something minimal.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2012-11-26 17:44:42

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: systemd & laptop power

Xyne wrote:

Do you have anything that isn't a baseless handwaving rant to back that up?

I have no data either, but Matthew Garret knows more than most about this stuff, so it is not just some random guy on the internet. I have yet to hear anyone (who knows what they are talking about) contradict Matthew's take on the situation, and there seems to be a general consensus that we should stop distinguishing between power-saving and normal operation, but always "DTRT".

I'd try to make some measurements to see if it makes any sense before working on adding support for switching governors/frequencies automatically (and if it turns out that it does make sense, that would be interesting as it is either a bug somewhere, or something that systemd upstream should learn to deal with).

Offline

#8 2012-11-26 18:15:13

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: systemd & laptop power

Reading this thread (and I think this is relevant enough to it to not be a hijack), I remembered that though I have cpupower installed, I haven't bothered doing any configuration. Looking at the wiki, it suggests that the default behaviour in the kernel is to just load the on demand governor and let it run at default settings. Am I right in assuming that the general consensous amongst though who (should) know, is that unless I have any special needs, I might as well just leave it at that - and thus I can remove cpupower?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#9 2012-11-26 18:16:08

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: systemd & laptop power

Hi!

I am already trying to do this, because udev rule does not seem to work for me either.
And my idea is basically to launch a simple script (which puts machine into "initial" power state) at boot from systemd service.
Then handle AC-online/AC-offline acpi events with the help of acpi daemon (acpid).
Thanks.

Offline

#10 2012-11-26 18:39:56

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: systemd & laptop power

skanky wrote:

Am I right in assuming that the general consensous amongst though who (should) know, is that unless I have any special needs, I might as well just leave it at that?

Yes.

Offline

#11 2012-11-26 19:30:42

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: systemd & laptop power

tomegun wrote:
skanky wrote:

Am I right in assuming that the general consensous amongst though who (should) know, is that unless I have any special needs, I might as well just leave it at that?

Yes.

Thank you smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#12 2012-11-27 00:42:45

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: systemd & laptop power

Even if changing the governor in response to ACPI events is futile, there may be other actions that I would like to trigger when the power is unplugged (e.g. dimming the screen, entering launch codes,  DDoS'ing the power company), so I am still interested in this.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2012-11-27 00:48:39

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: systemd & laptop power

Xyne wrote:

I'm looking for the simplest way to detect acpi events [...] The article recommends using udev rules, but they do not seem to work.

I don't have a battery, so can't test at the moment. Could it be that you get more than one event and both the "AC on" and the "AC off" scripts are ran? You might want to match the rule against only the AC (so it does not trigger on changes to the battery too). I.e., POWER_SUPPLY_NAME=="AC". That's all I could think of without having the possibility to test (the rule itself looks fine).

Offline

#14 2012-11-27 01:00:25

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,139

Re: systemd & laptop power

Is there any reason not to use laptop-mode tools?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB