power saving on laptop

One of the easiest way to make sure that you can have a decent battery life is

sudo yum install tlp smartmontools
sudo systemctl enable tlp
sudo systemctl start tlp

And after this you can check the status like this:

sudo tlp stat
— TLP 0.9 ——————————————–

+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
TLP_DEFAULT_MODE=AC
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
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_BAT=0
BAY_DEVICE=”sr0″
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto
RUNTIME_PM_ALL=1
RUNTIME_PM_DRIVER_BLACKLIST=”radeon nouveau”
USB_AUTOSUSPEND=1
USB_BLACKLIST_WWAN=1
RESTORE_DEVICE_STATE_ON_STARTUP=0

+++ System Info
System         = LENOVO Lenovo Y50-70 20378
BIOS           = 9ECN26WW(V1.09)
Release        = “Fedora release 25 (Twenty Five)”
Kernel         = 4.8.0-0.rc5.git1.1.fc25.x86_64 #1 SMP Tue Sep 6 15:52:10 UTC 2016 x86_64
/proc/cmdline  = BOOT_IMAGE=/vmlinuz-4.8.0-0.rc5.git1.1.fc25.x86_64 root=/dev/mapper/fedora_balp–fed–amitag-root ro nomodeset rd.lvm.lv=fedora_balp-fed-amitag/root vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora_balp-fed-amitag/swap rhgb quiet resume=/dev/dm-1 LANG=en_US.UTF-8
Init system    = systemd
Boot mode      = UEFI

+++ TLP Status
State          = enabled
Last run       = 12:16:55 PM,    556 sec(s) ago
Mode           = AC
Power source   = AC

Notice: [email protected] is not masked — invoke “systemctl mask [email protected]” to correct this!
Notice: systemd-rfkill.service is not masked — invoke “systemctl mask systemd-rfkill.service” to correct this!

+++ Processor
CPU model      = —————————————————–

/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]

 

Benchmarking the system/CPU performance

Have you ever wanted to have a quick check on your CPU performance. I know that lot of people will say that this is not the right way to do this, but here is something that you can use to check the CPU speed.

#!/bin/bash -
#===============================================================================
#
#          FILE:  benchmark.sh
#
#         USAGE:  ./benchmark.sh
#
#   DESCRIPTION:  Benchmark the CPU
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), [email protected]
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 09/21/2011 11:46:03 AM IST
# Last modified: Wed Sep 21, 2011  12:22PM
#      REVISION:  ---
#===============================================================================

add ()
{
    COUNTER=0
    exec 2>&1
    time=$(exec 2>&1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; done))
    echo "Time for 100000 additions is "$time
}	# ----------  end of function add  ----------
mul ()
{
    COUNTER=0
    test=2
    exec 2>&1
    time=$(exec 2>&1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; ((test=test*2));done))
    echo "Time for 100000 mul is "$time
}	# ----------  end of function add  ----------
div ()
{
    COUNTER=0
    test=1000000000000
    exec 2>&1
    time=$(exec 2>&1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; (( test=test/2)); done)|tr -d '\n')
    echo "Time for 100000 divisions is "${time}
}	# ----------  end of function add  ----------

time add
time mul
time div

And here is the output :

Time for 100000 additions is  real 0m1.166s user 0m1.089s sys 0m0.074s

real    0m1.168s
user    0m1.089s
sys    0m0.074s
Time for 100000 mul is  real 0m1.862s user 0m1.778s sys 0m0.082s

real    0m1.863s
user    0m1.779s
sys    0m0.082s
Time for 100000 divisions is  real 0m1.916s user 0m1.825s sys 0m0.089s

real    0m1.918s
user    0m1.825s
sys    0m0.090s

Enhanced by Zemanta