You are not logged in.

#326 2012-10-30 13:49:51

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: 3x+ battery life

If i use always powerdown script, even when i'm connected to AC, could i damage my laptop? This is my powerdown script:

#!/bin/sh

# bus
for i in /sys/bus/*/devices/*/power/control; do echo auto > $i; done
# usb autosuspend
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 10 > $i; done
for i in /sys/bus/usb/devices/*/power/level; do echo auto > $i; done
# nmi_watchdog -- DISABLED AT KERNEL
# cpu
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo powersave > $i; done
# aspm
echo powersave > /sys/module/pcie_aspm/parameters/policy
# kernel write mode
echo 5 > /proc/sys/vm/laptop_mode
echo 90 > /proc/sys/vm/dirty_ratio
echo 1 > /proc/sys/vm/dirty_background_ratio
echo 60000 > /proc/sys/vm/dirty_expire_centisecs
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# disk powersave
hdparm -S 6 -B 120 -a 2048 /dev/sda &> /dev/null
for i in /sys/class/scsi_host/host*/link_power_management_policy; do echo min_power > $i; done
# sound card powersave
echo 1 > /sys/module/snd_hda_intel/parameters/power_save
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
# wlan0 powersave
iwconfig wlan0 power on &> /dev/null
# screen powersave
for i in /sys/class/backlight/acpi_video*/brightness; do echo 7 > $i; done
xset +dpms
xset dpms 0 0 120
# radeon powersave
echo profile > /sys/class/drm/card0/device/power_method
echo low > /sys/class/drm/card0/device/power_profile

## all PCI devices are 'on' by default, we set power management to 'auto'
# Runtime PM for PCI Device Intel Corporation Device 151a
echo auto > /sys/bus/pci/devices/0000:03:00.0/power/control
# Runtime PM for PCI Device Broadcom Corporation BCM43224 802.11a/b/g/n
echo auto > /sys/bus/pci/devices/0000:02:00.0/power/control
# Runtime PM for PCI Device Intel Corporation Device 151a
echo auto > /sys/bus/pci/devices/0000:04:00.0/power/control
# Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family 4 port SATA IDE Controller
echo auto > /sys/bus/pci/devices/0000:00:1f.2/power/control
# Runtime PM for PCI Device Intel Corporation Device 1c27
echo auto > /sys/bus/pci/devices/0000:00:1d.0/power/control
# Runtime PM for PCI Device Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
echo auto > /sys/bus/pci/devices/0000:00:01.0/power/control

# Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
echo auto > /sys/bus/pci/devices/0000:00:16.0/power/control
# Runtime PM for PCI Device Intel Corporation Device 1c2c
echo auto > /sys/bus/pci/devices/0000:00:1a.0/power/control
# Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
echo auto > /sys/bus/pci/devices/0000:00:1b.0/power/control
# Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
echo auto > /sys/bus/pci/devices/0000:00:1c.0/power/control
# Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2
echo auto > /sys/bus/pci/devices/0000:00:1c.1/power/control
# Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family DRAM Controller
echo auto > /sys/bus/pci/devices/0000:00:00.0/power/control

# Disable bluetooth
modprobe -r btusb
modprobe -r bluetooth

# Disable webcam
modprobe -r uvcvideo
modprobe -r nouveau

Offline

#327 2012-10-30 13:58:50

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

Why don't you use ondemand governor? As far as i know, powersave it's not the best deal: if you run any heavy process, cpu governor won't scale with conservative, and may be it uses less power, but cpu will be used for longer time.
While with ondemand, cpu will scale to its maximum, and yes, it will drain more energy, but it will be for shorter time.
I've read about that somewhere, and there were some tests which tell powersave will not "save lots of power", because cpu idle time will be shorter.
By the way, you can use this while on ac too, but keep attenction to hdparm settings; they may kill your hdd smile
So apply them even on ac, only if your hard drive does not "click" too much time during your laptop usage.
,

Offline

#328 2012-10-30 14:16:10

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: 3x+ battery life

I think my hard drive is often "clicked" 'cause i always listen to music and so on ... which options would you recommend me to use? maybe i could use "-S1-B254"
Should i change also aspm option to ondemand?

Last edited by TheImmortalPhoenix (2012-10-30 14:19:13)

Offline

#329 2012-10-30 14:29:46

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

TheImmortalPhoenix wrote:

I think my hard drive is often "clicked" 'cause i always listen to music and so on ... which options would you recommend me to use? maybe i could use "-S1-B254"
Should i change also aspm option to ondemand?

I use these for hdparm to disable clicking:

hdparm -S 6 -B 254 -a 2048 /dev/sda &> /dev/null

EDIT: That's for powersave. For when I'm on AC, I use these:

hdparm -S 0 -B 254 -a 2048 /dev/sda &> /dev/null

Last edited by Unia (2012-10-30 14:30:27)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#330 2012-10-30 14:31:10

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

Well, if it is often "clicked" you should increase "hdparm -B" setting! I use "hdparm -B 200" on battery and 255 on ac, but it depends on your hdd! I can't say about "-S" setting, because i never understand it really...it depends too much from hdd and from your own will wink

Offline

#331 2012-10-30 14:38:27

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: 3x+ battery life

@Unia: i always use AC power, my battery is gone...But i don't want to use the powerup script 'cause the laptop heats up too much...I set hdparm to -S0 -B254, what about aspm parameter? Should i set it to powersave or ondemand?

These are my actual temperatures, i think they're not so bad

radeon-pci-0100
Adapter: PCI adapter
temp1:        +65.0°C  

acpitz-virtual-0
Adapter: Virtual device
temp1:        +57.0°C  (crit = +88.0°C)
temp2:        +57.0°C  (crit = +88.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +51.0°C  (high = +80.0°C, crit = +90.0°C)
Core 2:       +52.0°C  (high = +80.0°C, crit = +90.0°C)

/dev/sda: SAMSUNG HM500JI: 30°C

Last edited by TheImmortalPhoenix (2012-10-30 14:42:05)

Offline

#332 2012-10-30 15:09:35

cippaciong
Member
Registered: 2010-06-21
Posts: 104
Website

Re: 3x+ battery life

TheImmortalPhoenix wrote:

If i use always powerdown script, even when i'm connected to AC, could i damage my laptop?

I have particular interest in this question too..

Offline

#333 2012-10-30 17:01:43

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: 3x+ battery life

cippaciong wrote:
TheImmortalPhoenix wrote:

If i use always powerdown script, even when i'm connected to AC, could i damage my laptop?

I have particular interest in this question too..


Absolutely not. There are no settings here that can damage your laptop. In fact, I'd say your laptop is even safer using powerdown than not. Particularly your hard drive. With the unplugged settings, your hard drive is going to try to park its head more often, which means it is less likely to screw up your hard drive if it gets bounced around a little bit.

Otherwise, all you are doing is losing a little bit of performance, which I still don't recommend you do, but it's perfectly safe.

Offline

#334 2012-10-31 16:08:56

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

Some pages back I asked about disabling CD polling, which could be done with a udev rule using udisks.

I'm now curious, can it also be done with udisks2? I'm currently on a GNOME streak and GNOME uses udisks2 so I have no need for udisks other than the udev rule. In that case I'd like to get rid of it if it turns out to also be possible with udisks2.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#335 2012-10-31 19:06:02

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 436

Re: 3x+ battery life

It would be great if neither udisks nor udisks2 should be used

Offline

#336 2012-11-01 16:11:43

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

@unia
i think you either udisks or udisks2. both of them have the commit.

@TheImmortalPhoenix
three ways to do it:
1. udisks
2. old hal
3. self-written c program

i think udisks works great with udev, so i am not writing my own c stuff.


"After you do enough distro research, you will choose Arch."

Offline

#337 2012-11-01 21:42:04

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: 3x+ battery life

taylorchu wrote:

@unia
i think you either udisks or udisks2. both of them have the commit.

How can I test if this works with udisks2?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#338 2012-11-11 11:18:59

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

@taylorchu: i see you're still using  suspend functions in your powerdown script... you should remove them, i think, because users can now use systemctl suspend/hibernate to do the same things.
Tell me if i'm wrong!
Bye!

Offline

#339 2012-11-11 12:05:18

djipey
Member
Registered: 2011-07-30
Posts: 156

Re: 3x+ battery life

Guys, using powerdown solves some problems I had with Virtualbox. If I don't run powerdow/powerup before using a virtual machine, it makes me rebooting. If I run powerdown/powerup, I haven't any problem anymore.

I don't exactly know what the script does, but it's cool smile However, I have a question. When I'm on battery, I know that powerdown is run. But I would like to run powerup at boot automatically, even when I'm on AC. Is there a udev rule already for that ? Does powerup do some "special things", or does it simply revert what powerdown does ?

sincerely

Offline

#340 2012-11-11 12:45:15

OdinEidolon
Member
From: Belluno - Italy
Registered: 2011-01-31
Posts: 498

Re: 3x+ battery life

I have an issue maybe related to this: when shutting down the computer, 30% of the time instead of doing so it goes into suspend-to-ram. Then waking it from suspend makes it shut down by itself in about 4 seconds. Could this be powerdown-related? The system is the one in signature.

Suspend to ram works OK otherwise.


Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee

Offline

#341 2012-11-11 13:08:00

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

Powerup revert the most of powerdown script. But you don't have to touch anything, because it is automagically run by uved when you connect to AC.  So yea, there's already an udev rule to do that smile

Offline

#342 2012-11-11 13:10:13

djipey
Member
Registered: 2011-07-30
Posts: 156

Re: 3x+ battery life

When I connect to AC, but if I start already connected to AC ? I'm almost sure in that case powerup is not activated, because I' ve seen a difference by running it. What do you think ?

Offline

#343 2012-11-11 13:25:16

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

No, it should be run powerup anyway, because the udev rule does a check if you're on ac or on battery, not if you connect or not the ac cable. On my netbook, if i bootup connected to ac, i'm  fine with "powerup" script ( actually i don't use powerdown/powerup, but a script of mine. The udev rule is the same though)

Offline

#344 2012-11-11 13:31:38

djipey
Member
Registered: 2011-07-30
Posts: 156

Re: 3x+ battery life

Ok. So if I'm not wrong, is it possible to check if this rule is enabled for me ?

EDIT:

djipey-laptop:14:31:45:~$ search powerdown
1 aur/powerdown 20120927-1 [installed: 20121025-1] (24)
    lazy powersave for linux

???

Last edited by djipey (2012-11-11 13:33:11)

Offline

#345 2012-11-11 14:29:28

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

mmh, it is enough to "cat /sys/devices/cpu/cpu0/cpufreq/scaling_governor". While on AC, should return "performance".

Offline

#346 2012-11-11 20:07:48

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: 3x+ battery life

You don't want performance, even on AC. Keep it on ondemand.

Offline

#347 2012-11-11 20:17:22

djipey
Member
Registered: 2011-07-30
Posts: 156

Re: 3x+ battery life

It returns "performance", I haven't modified anything from the original script.

Offline

#348 2012-11-12 09:40:45

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

Then I was right, powerup is running.
@Kaustic: it is a powerdown's developer choice to use performance while on ac. Bother him wink

Offline

#349 2012-11-12 12:13:47

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: 3x+ battery life

Hi, I have noticed that the following udev 99-powerdown.rules provided by powerdown do nothing in my system:

KERNEL=="AC0", SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/bin/powerdown"
KERNEL=="AC0", SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/bin/powerup"

Powerdown and powerup are never automatically executed by udev. Thus, I have created acpid events/actions for the same purpose and now powerdown is executed when I unplug AC and powerup when I plug it. However, I am wondering why the udev rules do not work. Any idea? My battery is numbered BAT1 instead of BAT0 in /sys. Could it be that "AC0" is not the right name for AC in my system?

EDIT: I answer myself, yes, it is enough to replace "ACAD" to "AC0".

Last edited by patroclo7 (2012-11-12 12:17:39)


Mortuus in anima, curam gero cutis

Offline

#350 2012-11-12 12:17:26

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: 3x+ battery life

I see you're italian.
I already had this kind of problem with a guy, so, please, read his solution (go on read from there) : http://www.archlinux.it/forum/viewtopic … 07#p130507 .
Hope you find this useful.
But don't ask me the reason why it happens smile

Offline

Board footer

Powered by FluxBB