Enable Laptop mode to save power and lower CPU temp

Laptop mode explained:

Laptop mode is used to minimize the time that the hard disk needs to be spun up, to conserve battery power on laptops. It has been reported to cause significant power savings.

Laptop mode is controlled by the knob /proc/sys/vm/laptop_mode. This knob is present for all kernels that have the laptop mode patch, regardless of any configuration options. When the knob is set, any physical disk I/O (that might have caused the hard disk to spin up) causes Linux to flush all dirty blocks. The result of this is that after a disk has spun down, it will not be spun up anymore to write dirty blocks, because those blocks had already been written immediately after the most recent read operation. The value of the laptop_mode knob determines the time between the occurrence of disk I/O and when the flush is triggered. A sensible value for the knob is 5 seconds. Setting the knob to 0 disables laptop mode.

To increase the effectiveness of the laptop_mode strategy, the laptop_mode control script increases dirty_expire_centisecs and dirty_writeback_centisecs in /proc/sys/vm to about 10 minutes (by default), which means that pages that are dirtied are not forced to be written to disk as often. The control script also changes the dirty background ratio, so that background writeback of dirty pages is not done anymore. Combined with a higher commit value (also 10 minutes) for ext3 or ReiserFS filesystems (also done automatically by the control script), this results in concentration of disk activity in a small time interval which occurs only once every 10 minutes, or whenever the disk is forced to spin up by a cache miss. The disk can then be spun down in the periods of inactivity.

If you want to find out which process caused the disk to spin up, you can gather information by setting the flag /proc/sys/vm/block_dump. When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk needs to spin up, and to increase battery life even more. The output of block_dump is written to the kernel output, and it can be retrieved using “dmesg”. When you use block_dump and your kernel logging level also includes kernel debugging messages, you probably want to turn off klogd, otherwise the output of block_dump will be logged, causing disk activity that is not normally there. More interested users should look laptop mode up in www.kernel.org, the big daddy of all linux distribution. (or mommy, not too sure!)

Enable Laptop mode to save power and lower CPU temp - blackMORE Ops

Install Laptop Mode tools:

Quite easy, just do the following and you’re done.

apt-get install laptop-mode-tools

Enable Laptop mode to save power and lower CPU temp:

vi /proc/sys/vm/laptop_mode

Replace the number with 5.

Save and exit. Now reboot. Enjoy.

  reboot

Done.

Check Also

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

If you’ve encountered an issue where Hashcat initially only recognizes your CPU and not the …

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

This is a guide for configuring Raspberry Pi4 to boot Ubuntu from external USB SSD …

3 comments

  1. Hey BMO,
    I have been facing overheat problem lately on my laptop (Lenovo Ideapad Y410p). I dont think its overheating but to some extent it is. I need you help on this issue.

    I have dual booted kali linux 1.0.6 amd64. But while installing I have 4 partitions for \boot \ \home and \swap. The thing I did here was, I kept the the partitions as logical. Does that make any sense to result in heating of my laptop?? I think most heated part is My hard drive, since it is placed of left side. So I could feel the heat of it. Next thing is, I have one dedicated graphic card i.e. NVIDIA GT755 2GB. I am pasting my laptop temperature and its configurations.

    If there is something I could do then please help.

    Thanks in advance! :)
    _____________________________

    root@SarthaKJ:~# lscpu
    Architecture: x86_64
    CPU op-mode(s): 32-bit, 64-bit
    Byte Order: Little Endian
    CPU(s): 8
    On-line CPU(s) list: 0-7
    Thread(s) per core: 2
    Core(s) per socket: 4
    Socket(s): 1
    NUMA node(s): 1
    Vendor ID: GenuineIntel
    CPU family: 6
    Model: 60
    Stepping: 3
    CPU MHz: 2400.843
    BogoMIPS: 4789.37
    Virtualization: VT-x
    L1d cache: 32K
    L1i cache: 32K
    L2 cache: 256K
    L3 cache: 6144K
    NUMA node0 CPU(s): 0-7
    ————————————————————————

    root@SarthaKJ:~# lspci | grep VGA
    00:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev 06)
    01:00.0 VGA compatible controller: NVIDIA Corporation Device 0fcd (rev a1)

    ————————————————————————
    root@SarthaKJ:~# sensors
    acpitz-virtual-0
    Adapter: Virtual device
    temp1: +0.0°C (crit = +127.0°C)

    coretemp-isa-0000
    Adapter: ISA adapter
    Physical id 0: +52.0°C (high = +84.0°C, crit = +100.0°C)
    Core 0: +51.0°C (high = +84.0°C, crit = +100.0°C)
    Core 1: +49.0°C (high = +84.0°C, crit = +100.0°C)
    Core 2: +49.0°C (high = +84.0°C, crit = +100.0°C)
    Core 3: +49.0°C (high = +84.0°C, crit = +100.0°C)

    pkg-temp-0-virtual-0
    Adapter: Virtual device
    temp1: +52.0°C

    nouveau-pci-0100
    Adapter: PCI adapter
    temp1: N/A (high = +95.0°C, hyst = +3.0°C)
    (crit = +105.0°C, hyst = +5.0°C)
    (emerg = +135.0°C, hyst = +5.0°C)
    ————————————————————————–

    root@SarthaKJ:~# hddtemp /dev/sda
    /dev/sda: ST1000LM024 HN-M101MBB: drive is sleeping
    root@SarthaKJ:~# hddtemp /dev/sda
    /dev/sda: ST1000LM024 HN-M101MBB: drive is sleeping
    root@SarthaKJ:~# hddtemp /dev/sda
    /dev/sda: ST1000LM024 HN-M101MBB: drive is sleeping
    root@SarthaKJ:~# hddtemp /dev/sda
    /dev/sda: ST1000LM024 HN-M101MBB: 38°C
    root@SarthaKJ:~# hddtemp /dev/sda
    /dev/sda: ST1000LM024 HN-M101MBB: 38°C
    ————————————————————————–

    root@SarthaKJ:~# lspci
    00:00.0 Host bridge: Intel Corporation Haswell DRAM Controller (rev 06)
    00:01.0 PCI bridge: Intel Corporation Haswell PCI Express x16 Controller (rev 06)
    00:02.0 VGA compatible controller: Intel Corporation Haswell Integrated Graphics Controller (rev 06)
    00:03.0 Audio device: Intel Corporation Haswell HD Audio Controller (rev 06)
    00:14.0 USB controller: Intel Corporation Lynx Point USB xHCI Host Controller (rev 05)
    00:16.0 Communication controller: Intel Corporation Lynx Point MEI Controller #1 (rev 04)
    00:1a.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #2 (rev 05)
    00:1b.0 Audio device: Intel Corporation Lynx Point High Definition Audio Controller (rev 05)
    00:1c.0 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #4 (rev d5)
    00:1c.4 PCI bridge: Intel Corporation Lynx Point PCI Express Root Port #5 (rev d5)
    00:1d.0 USB controller: Intel Corporation Lynx Point USB Enhanced Host Controller #1 (rev 05)
    00:1f.0 ISA bridge: Intel Corporation Lynx Point LPC Controller (rev 05)
    00:1f.2 SATA controller: Intel Corporation Lynx Point 6-port SATA Controller 1 [AHCI mode] (rev 05)
    00:1f.3 SMBus: Intel Corporation Lynx Point SMBus Controller (rev 05)
    01:00.0 VGA compatible controller: NVIDIA Corporation Device 0fcd (rev a1)
    07:00.0 Ethernet controller: Atheros Communications Inc. Device 10a1 (rev 10)
    08:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)

    ————————————————————————

  2. Thanks for the tutorial , but on my Asus G74SX this seems not work i get this on the install

    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor
    SETTING OF KERNEL PARAMETER FAILED: echo ondemand \> /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor).

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading