• Battery Optimization Besides Powertop and TLP


    Hi guys.

    I’ve been chasing battery optimization on Linux for quite some time, with all the different ditros that I’ve used. After installing Powertop, and enabling TLP on boot (pre-installed yay!), I saw a significant bump in battery life, but still not too great. I average about 3.5-4 hours on a normal day.

    For reference, I run a Dell XPS 15 9530 (2015) with an i7 4712hq, 16gb ram, 512gb SSD, QHD+ display, and a 91Wh battery, although I only get about 73Wh. I am planning on replacing my battery soon for that extra 25%, but in the meantime, I’m still not getting as good battery life as Windows 10.

    My idle power consumption is around 12-13 watts at complete idle (wifi and bluetooth on), 15-17 watts for light web browsing, and 18-26 watts for Youtube, Netflix, etc. For reference, I mostly use this system for school and media consumption, always run my screen at min brightness and use a pair of bluetooth headphones.

    I guess what I’m asking is what kinds of other things can I do to increase my battery life, besides Pwertop and TLP. I’ve read probably hundreds of guides on power management, but they all seem to either use tlp/powertop, or modify things that they already do. I’m pretty comfortable editing conf files and using the terminal to optimize.

    What do you guys recommend for optimal battery life?

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • I don’t know if this will help at all, but this articleon the Arch wiki might help…

    Keep trying, never give up. In the end, you will find that it was all worth it

    Just have some relatives over. Be back in about a week

    Community ISO: https://antergoscommunityeditions.wordpress.com
    Linux Basics: https://linuxbasicssite.wordpress.com

  • @Keegan Thanks for the link. I looked at the script those guys were building, and I’d say almost everything (haven’t gone through it all yet) is covered under TLP and powertop. I’m starting to think I’m just running out of things to optimize, but my power draw is still high.

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • @mach01dan said in Battery Optimization Besides Powertop and TLP:

    For reference, I run a Dell XPS 15 9530 (2015) with an i7 4712hq, 16gb ram, 512gb SSD, QHD+ display, and a 91Wh battery, although I only get about 73Wh. I am planning on replacing my battery

    My Dell is an Ultrabook Inspiron z14 with i7 and my acpi -V is this:

    Battery 0: design capacity 4000 mAh, last full capacity 3245 mAh = 81%
    
    

    It seems to me that I am not to change the battery, if I did not misunderstand its posteo … it is normal that the batteries do not work at 100% sometimes work more than 50% down, anyway, everything is relative in these needs.
    My TLP is enable

    It is my opinion :)

    Autodidacta en la VIDA …y en Linux, también.

  • hey @judd I think that you and I are both suffering from battery degeneration, or the cells are just getting weaker and not able to hold their full charge. This is normal, albeit very annoying and expensive problem. There’s nothing software based to fix the problem, some pieces to slow it down, but ultimately, you just need to buy new batteries every once in a while.

    Fortunately, Dell replacement batteries are not that bad (probably around $80 for me and maybe $60 for you.)

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • So that you can compare, here I leave you my:

    # tlp stat
    --- TLP 1.0 --------------------------------------------
    
    +++ Configured Settings: /etc/default/tlp
    TLP_ENABLE=1
    TLP_DEFAULT_MODE=AC
    TLP_PERSISTENT_DEFAULT=0
    DISK_IDLE_SECS_ON_AC=0
    DISK_IDLE_SECS_ON_BAT=2
    MAX_LOST_WORK_SECS_ON_AC=15
    MAX_LOST_WORK_SECS_ON_BAT=60
    CPU_HWP_ON_AC=balance_performance
    CPU_HWP_ON_BAT=balance_power
    SCHED_POWERSAVE_ON_AC=0
    SCHED_POWERSAVE_ON_BAT=1
    NMI_WATCHDOG=0
    ENERGY_PERF_POLICY_ON_AC=performance
    ENERGY_PERF_POLICY_ON_BAT=powersave
    DISK_DEVICES="sda sdb"
    DISK_APM_LEVEL_ON_AC="254 254"
    DISK_APM_LEVEL_ON_BAT="128 128"
    SATA_LINKPWR_ON_AC=max_performance
    SATA_LINKPWR_ON_BAT=min_power
    AHCI_RUNTIME_PM_TIMEOUT=15
    PCIE_ASPM_ON_AC=performance
    PCIE_ASPM_ON_BAT=powersave
    RADEON_POWER_PROFILE_ON_AC=high
    RADEON_POWER_PROFILE_ON_BAT=low
    RADEON_DPM_STATE_ON_AC=performance
    RADEON_DPM_STATE_ON_BAT=battery
    RADEON_DPM_PERF_LEVEL_ON_AC=auto
    RADEON_DPM_PERF_LEVEL_ON_BAT=auto
    WIFI_PWR_ON_AC=off
    WIFI_PWR_ON_BAT=on
    WOL_DISABLE=Y
    SOUND_POWER_SAVE_ON_AC=0
    SOUND_POWER_SAVE_ON_BAT=1
    SOUND_POWER_SAVE_CONTROLLER=Y
    BAY_POWEROFF_ON_AC=0
    BAY_POWEROFF_ON_BAT=0
    BAY_DEVICE="sr0"
    RUNTIME_PM_ON_AC=on
    RUNTIME_PM_ON_BAT=auto
    USB_AUTOSUSPEND=1
    USB_BLACKLIST_BTUSB=0
    USB_BLACKLIST_PHONE=0
    USB_BLACKLIST_WWAN=1
    RESTORE_DEVICE_STATE_ON_STARTUP=0
    
    +++ System Info
    System         = Dell Inc. Not Specified Inspiron 5423
    BIOS           = A08
    Kernel         = 4.9.37-1-lts #1 SMP Wed Jul 12 19:22:39 CEST 2017 x86_64
    /proc/cmdline  = BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=df548a45-26e2-448c-8c6a-964a8bcd1b6b rw quiet
    Init system    = systemd 
    Boot mode      = UEFI
    
    +++ TLP Status
    State          = enabled
    Last run       = 15:04:12,     54 sec(s) ago
    Mode           = battery
    Power source   = battery
    
    +++ Processor
    CPU model      = Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz
    
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver    = intel_pstate
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = powersave
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   800000 [kHz]
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  3000000 [kHz]
    
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver    = intel_pstate
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor  = powersave
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq  =   800000 [kHz]
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq  =  3000000 [kHz]
    
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_driver    = intel_pstate
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor  = powersave
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq  =   800000 [kHz]
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq  =  3000000 [kHz]
    
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_driver    = intel_pstate
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor  = powersave
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq  =   800000 [kHz]
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq  =  3000000 [kHz]
    
    /sys/devices/system/cpu/intel_pstate/min_perf_pct      =  26 [%]
    /sys/devices/system/cpu/intel_pstate/max_perf_pct      = 100 [%]
    /sys/devices/system/cpu/intel_pstate/no_turbo          =   0
    /sys/devices/system/cpu/intel_pstate/turbo_pct         =  49 [%]
    /sys/devices/system/cpu/intel_pstate/num_pstates       =  23
    
    x86_energy_perf_policy: program not installed.
    
    /sys/module/workqueue/parameters/power_efficient       = Y
    /proc/sys/kernel/nmi_watchdog                          = 0
    
    +++ Undervolting
    PHC kernel not available.
    
    +++ Temperatures
    CPU temp               =    51 [°C]
    Fan speed (fan1)       =     0 [/min]
    
    +++ File System
    /proc/sys/vm/laptop_mode               =     2
    /proc/sys/vm/dirty_writeback_centisecs =  6000
    /proc/sys/vm/dirty_expire_centisecs    =  6000
    /proc/sys/vm/dirty_ratio               =    20
    /proc/sys/vm/dirty_background_ratio    =    10
    /proc/sys/fs/xfs/xfssyncd_centisecs    =  6000
    
    +++ Storage Devices
    /dev/sda:
      Model     = WDC WD5000LPVT-75G33T0                  
      Firmware  = 01.01A01
      APM Level = 128
      Status    = active/idle
      Scheduler = deadline
    
      Runtime PM: control = on, autosuspend_delay =   -1
    
      SMART info:
          4 Start_Stop_Count          =     4493 
          5 Reallocated_Sector_Ct     =        0 
          9 Power_On_Hours            =     2048 [h]
         12 Power_Cycle_Count         =     3443 
        191 G-Sense_Error_Rate        =      250 
        193 Load_Cycle_Count          =   101329 
        194 Temperature_Celsius       =       28    [°C]
        241 Total_LBAs_Written        =    1.574 [TB]
    
    /dev/sdb:
      Model     = Micron C400 RealSSD mSATA 32GB          
      Firmware  = 01MG    
      APM Level = 128
      Status    = active/idle
      TRIM      = supported
      Scheduler = deadline
    
      Runtime PM: control = on, autosuspend_delay =   -1
    
      SMART info:
          5 Reallocated_Sector_Ct     =        0 
         12 Power_Cycle_Count         =     3444 
        177 Wear_Leveling_Count       =      100 [%]
        178 Used_Rsvd_Blk_Cnt_Chip    =        4 
        179 Used_Rsvd_Blk_Cnt_Tot     =        0 
        180 Unused_Rsvd_Blk_Cnt_Tot   =     2157 
        241 Total_LBAs_Written        =    0.692 [TB]
    
    
    +++ SATA Aggressive Link Power Management
    /sys/class/scsi_host/host0/link_power_management_policy  = min_power
    /sys/class/scsi_host/host1/link_power_management_policy  = min_power
    /sys/class/scsi_host/host2/link_power_management_policy  = min_power
    /sys/class/scsi_host/host3/link_power_management_policy  = min_power
    /sys/class/scsi_host/host4/link_power_management_policy  = min_power
    /sys/class/scsi_host/host5/link_power_management_policy  = min_power
    
    +++ AHCI Host Controller Runtime Power Management
    /sys/bus/pci/devices/0000:00:1f.2/ata1/power/control = on
    /sys/bus/pci/devices/0000:00:1f.2/ata2/power/control = on
    /sys/bus/pci/devices/0000:00:1f.2/ata3/power/control = on
    /sys/bus/pci/devices/0000:00:1f.2/ata4/power/control = on
    /sys/bus/pci/devices/0000:00:1f.2/ata5/power/control = on
    /sys/bus/pci/devices/0000:00:1f.2/ata6/power/control = on
    
    +++ PCIe Active State Power Management
    /sys/module/pcie_aspm/parameters/policy = default (using bios preferences)
    
    +++ Intel Graphics
    /sys/module/i915/parameters/enable_rc6       =  3 (enabled + deep)
    /sys/module/i915/parameters/enable_dc        = -1 (use per-chip default)
    /sys/module/i915/parameters/enable_fbc       =  0 (disabled)
    /sys/module/i915/parameters/enable_psr       =  0 (disabled)
    /sys/module/i915/parameters/modeset          = -1 (use per-chip default)
    /sys/module/i915/parameters/semaphores       =  1 (enabled)
    
    +++ Radeon Graphics
    /sys/class/drm/card1/device/power_dpm_state = battery
    /sys/class/drm/card1/device/power_dpm_force_performance_level = off
    
    +++ Wireless
    bluetooth = on
    wifi      = on
    wwan      = none (no device)
    
    hci0(btusb)                   : bluetooth, not connected
    wlp7s0(wl)                    : wifi, connected, power management = on
    
    +++ Audio
    /sys/module/snd_hda_intel/parameters/power_save            = 1
    /sys/module/snd_hda_intel/parameters/power_save_controller = Y
    
    +++ Runtime Power Management
    Device blacklist = (not configured)
    Driver blacklist = amdgpu nouveau nvidia radeon (default)
    
    /sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, ivb_uncore)
    /sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport)
    /sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915)
    /sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd)
    /sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me)
    /sys/bus/pci/devices/0000:00:1a.0/power/control = auto (0x0c0320, USB controller, ehci-pci)
    /sys/bus/pci/devices/0000:00:1b.0/power/control = auto (0x040300, Audio device, snd_hda_intel)
    /sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport)
    /sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport)
    /sys/bus/pci/devices/0000:00:1c.5/power/control = auto (0x060400, PCI bridge, pcieport)
    /sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x0c0320, USB controller, ehci-pci)
    /sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, lpc_ich)
    /sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x010400, RAID bus controller, ahci)
    /sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x0c0500, SMBus, i801_smbus)
    /sys/bus/pci/devices/0000:02:00.0/power/control = auto (0x030000, VGA compatible controller, radeon)
    /sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x028000, Network controller, wl)
    /sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, alx)
    
    +++ USB
    Autosuspend         = enabled
    Device whitelist    = (not configured)
    Device blacklist    = (not configured)
    Bluetooth blacklist = disabled
    Phone blacklist     = disabled
    WWAN blacklist      = enabled
    
    Bus 002 Device 002 ID 8087:0024 control = auto, autosuspend_delay_ms =     0 -- Intel Corp. Integrated Rate Matching Hub (hub)
    Bus 002 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 2.0 root hub (hub)
    Bus 001 Device 005 ID 1bcf:2982 control = auto, autosuspend_delay_ms =  2000 -- Sunplus Innovation Technology Inc.  (uvcvideo)
    Bus 001 Device 004 ID 0a5c:21d7 control = auto, autosuspend_delay_ms =  2000 -- Broadcom Corp. BCM43142 Bluetooth 4.0 (btusb)
    Bus 001 Device 003 ID 0bda:0129 control = auto, autosuspend_delay_ms =  2000 -- Realtek Semiconductor Corp. RTS5129 Card Reader Controller (rtsx_usb)
    Bus 001 Device 002 ID 8087:0024 control = auto, autosuspend_delay_ms =     0 -- Intel Corp. Integrated Rate Matching Hub (hub)
    Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 2.0 root hub (hub)
    Bus 004 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 3.0 root hub (hub)
    Bus 003 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms =     0 -- Linux Foundation 2.0 root hub (hub)
    
    +++ Battery Status
    /sys/class/power_supply/BAT0/manufacturer                   = SMP-SDI2.0
    /sys/class/power_supply/BAT0/model_name                     = DELL 8JVDG27
    /sys/class/power_supply/BAT0/cycle_count                    = (not supported)
    /sys/class/power_supply/BAT0/charge_full_design             =   4000 [mAh]
    /sys/class/power_supply/BAT0/charge_full                    =   3245 [mAh]
    /sys/class/power_supply/BAT0/charge_now                     =   1093 [mAh]
    /sys/class/power_supply/BAT0/current_now                    =    890 [mA]
    /sys/class/power_supply/BAT0/status                         = Discharging
    
    Charge                                                      =   33.7 [%]
    Capacity                                                    =   81.1 [%]
    
    +++ Warnings
    * Kernel log shows ata errors (2) possibly caused by the configuration
      SATA_LINKPWR_ON_AC/BAT=min_power or medium_power.
      Consider using medium_power or max_performance instead.
      See the FAQ: http://linrunner.de/en/tlp/docs/tlp-faq.html#warnings
      Details:
    [    7.161392] ata2: SError: { HostInt CommWake }
    [    7.162141] ata2: hard resetting link
    [    7.487851] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    [    7.488830] ata2.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
    [    7.488839] ata2.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
    [    7.488843] ata2.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
    --
    [  937.167714] ata2: SError: { HostInt CommWake }
    [  937.167720] ata2: hard resetting link
    [  937.500766] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    [  937.501549] ata2.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
    [  937.501553] ata2.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
    [  937.501556] ata2.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
    
    
    

    Autodidacta en la VIDA …y en Linux, también.

  • @mach01dan

    • You may switch to integrated intel graphics instead of nvidia.

    • I find this kernel parameter, pcie_aspm=force, quite useful for battery optimization. Though it just helps with the idle power I think.

    • Choice of DE helps quite a bit - in most cases. But, if you use services like Netflix, this won’t matter as much.

    In general, you can get quite a bit of juice with tlp in linux when components are idle. However, I believe most linux software are not well optimized for power management - at least not the priority. So, it is not very surprising to see windows pulls ahead here.

  • @judd Thanks for the TLP config. It’s almost completely identical to mine :).

    @psscnp142 Yes, I have completely disabled my GPU and run only Intel graphics.

    What does pcie_aspm=force actually do? Where would I put that?

    I currently run Gnome and don’t really ever plan on switching (long time user) so I guess I’ll have to factor that power consumption into my build.

    Agreed, I think it’s mostly driver issues to be honest, and companies not giving their driver code away to be optimized for people like us.

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • @mach01dan said in Battery Optimization Besides Powertop and TLP:

    you just need to buy new batteries every once in a while.

    También puede usar con el cable de la alimentación eléctrica sin ningún problema, salve un corte de luz, tengo una computadora portátil con un i3 funcionando todo el día enchufado a la corriente y sin ningún problema

    Autodidacta en la VIDA …y en Linux, también.

  • @judd Unfortunately, as a student, I often don’t have that luxury on the go, and especially when I’m traveling.

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • @mach01dan said in Battery Optimization Besides Powertop and TLP:

    @judd Unfortunately, as a student, I often don’t have that luxury on the go, and especially when I’m traveling.

    I understand clear

    Autodidacta en la VIDA …y en Linux, también.

  • @psscnp142 Thanks, I checked and those are covered by Powertop.

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

  • @mach01dan

    Just another thought, you may switch to gnome on Xorg. It may be hardware dependent but I get slight increase in the battery life. I find this weird but it may work for you as well.

  • I’ve tried that, and get very marginal improvement. However, I don’t really feel comfortable running in Xorg full time, and there’s some odd mousepad bugs that I can’t seem to fix on it.

    Ubuntu ~ Debian ~ Fedora ~ Antergos
    Dell XPS 15 9530

Posts 15Views 418
Log in to reply