Not a member yet? Why not Sign up today
Create an account  

  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Laptop-mode config needs adjustments for xanmod!

#1
Hello forum followers!

I thought it could be useful to notify here that laptop-mode users need to make some changes to the /etc/laptop-mode/laptop-mode.conf file in order that it will continue the enhancements offered by xanmod kernels!

I am currently using 4.11.9-xanmod13.

The config for laptop-mode can now be identified as blocking the dirty_ratio and dirty_background_ratio (for example) implemented by xanmod (although this can be fixed).

To the point, what I changed and noticed improvements which were most apparent on my HP mini 210-1000:

1) XFS_HZ=500 (default was 100) NOTE: I assume this is the same frequency as that by which the xanmod kernels are compiled.  If this is WRONG, no problem for me, do make corrections please!

2) CONTROL_MOUNT_OPTIONS=0 (default was 1) NOTE: this disables laptop-mode changing tuned fstab mount options (I use my own mods and was previously oblivious to the fact that my tweaks were being over-riled by laptop-mode tools).

3) LM_DIRTY_RATIO=20  (default was 40)
    NOLM_DIRTY_RATIO=20  (default was 60)

4) LM_DIRTY_BACKGROUND_RATIO=5  (default was 1)
    NOLM_DIRTY_BACKGROUND_RATIO=5  (default was 10)

5) CONTROL_HD_IDLE_TIMEOUT=0   (default was 1)

6) CONTROL_NOATIME=0  (default was 0 or 1)
    USE_RELATIME=0  (default was 0 or 1)
NOTE: I use noatime in mount options specified in fstab.  If you do not want laptop-mode tools to meddle with your fstab mount options, turn these off also (i.e. use a value 0) and see 2) above.

7) CONTROL_READAHEAD=0  (default was 1)

NOTE:  one needs to think about other systems settings on "their" environment and not blindly follow this since each system/box can and will be set up differently.  I accept no responsibility for anyone using the settings I found helped me!

I need to survey further with more usage, but making these changes seems to allow xanmod to do its thing performance-wise while still observing decent battery savings.  Of course, "you" may find a different end result.

In addition, there are some further tweaks I think could be made, and perhaps those associated with xanmod could comment?

For example, these following values are defaults in the laptop-mode config file, but I've no idea if they match those of the native 4.11.9-xanmod13:

#
# kernel default settings -- don't touch these unless you know what you're
# doing.
#
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
DEF_MAX_AGE=30

Are these values xanmod uses, or, should they be adjusted in order to match?
Reply

#2
@GWD72
Hello again! Well, near one year ago I introduced the TLP software:  "TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.".
https://forum.xanmod.org/thread-4.html
http://linrunner.de/en/tlp/docs/tlp-linu...ement.html

I introduced also near one year ago the PowerTop utility, a very advanced utility: "[it's] a power management tool to diagnose the power related issues. It helps to reduce the power consumption and extends the battery life making it more healthy and robust. PowerTOP is built with amazing utilities like sensors, powersave and cpu governer, each one plays its own role and at the end we get a very low power consumption."
https://forum.xanmod.org/thread-139.html
http://linuxpitstop.com/install-powertop-on-ubuntu/

TLP is very easy to use and it works better than laptop-mode with no problem at all, while PowerTop is more oriented to advanced users.

My former experience with laptop-mode was not good, so the best tweaks in your case are about dirty_ratio and dirty_background_ratio because both were unexpectedly overwritten for you in the past -- changing the other values will probably reduce the performance and enhancements of the XanMod experience, so please read carefully the laptop-mode preferences before to apply further changes.
http://manpages.ubuntu.com/manpages/zest...onf.8.html
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#3
Hi tropic,

Ya, I have seen the thread about TLP but I prefer laptop-mode tools.  Actually I was aware of TLP already when I started with laptop-mode tools.  I already have powertop in action for ages.  And I use cpufreqd for cpu control since I like the way I can tune it (i.e. it is highly configurable).

Performance is up slightly on HP 2560p and Dell e6320, and very noticeably on an HP mini with atom N450,  compared to before I made these changes, and battery life is as good as ever, which is, depending on what I am doing, 8-10 h.

I had the rc.local file taking care of the dirty values, and yes, the laptop-mode config was the culprit, but also setting the XFS-HZ=500 (up from 100) is important, I believe (based on what I'd already read from the man pages).

I highly doubt the way I had laptop-mode previously configured "hurt" the performance of xanmod much (also because I was anyway forcing the correct dirty values in rc.local), since my systems were definitely noticeably snappier after using xanmod to begin with.  And now that I have the laptop-mode tools tamed (i.e. I have removed laptop-mode adjusting mount options, disk idle etc) and  somewhat more in tune with xanmod, the throughput is more solid and consistently faster.  If anything, I have let xanmod be itself much more than laptop-mode was originally allowing).

I also turned off laptop-mode completely, in my original "test", to see if my system picked up without it (irregardless of impact on battery), which it did.  And then after i "fixed" some bad settings in the config file, and then turned laptop-mode back on, my system feels like it did when I had it turned off, plus my battery capacity has not changed. Even as I write this I am not more than 9 W (and still plenty to play with on the back-light).  I have also seen as low as 6W idling, in which case my standby time goes to more than ~12 h (and yes, I have a 9-cell battery with a usable 91 Wh of 100 Wh rating).

As for the other values (from the bottom of post #1), since there is essentially zero information about them from the man page (relatively speaking),  or here, I will leave them as they are by default.

Cheers!!

EDIT 1: based on information in the man pages, and cross-referencing with general search "xfs frequency and timer interrupt frequency" I can confirm what I'd previously assumed, that the laptop-mode tools XFS_HZ is in fact the "timer interrupt frequency" and so xanmod users should set XFS-HZ=500 from XFS-HZ=100 in the config file.

EDIT 2: Looking at the TLP man pages, it would seem configurations also need to be changed from defaults.  For example, there is an option for the battery time scheduler, and it is defaulting to cfq, not bfq, for example.  And looking between laptop-mode and TLP, they basically share similar commands that can either be left to defaults, or tweaked, with laptop-mode tools giving much more flexibility and control over how battery savings are implemented (for TLP see: http://linrunner.de/en/tlp/docs/tlp-configuration.html)
Reply

#4
@GWD72
The power consumption depends on many things, but we need to use the common sense:

1) the standby time lenght is just 'worthless' in the real world,
2) the harder the task, the lower the battery lenght,
3) the brighter the screen, the lower the battery lenght,
4) the higher the sound volume, the lower the battery lenght,
5) TLP saves more battery than laptop-mode by default,
6) TLP does not need additional tuning to make its job,
7) Laptop-mode causes problems with suspend/hibernate,
8) Powertop will show you the power leaks in your system.

More useful ways that may help to save battery (please, don't expect miracles):
http://www.omgubuntu.co.uk/2016/04/impro...life-linux
https://wiki.ubuntu.com/Kernel/PowerMana...vingTweaks

Edit: I added your tweaking criteria to the 'Brainstorming for XanMod Kernel' topic.
https://forum.xanmod.org/thread-142-post...ml#pid2304
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#5
(11-07-2017, 08:18 PM)tropic Wrote: @GWD72
The power consumption depends on many things, but we need to use the common sense:

1) the standby time lenght is just 'worthless' in the real world,
2) the harder the task, the lower the battery lenght,
3) the brighter the screen, the lower the battery lenght,
4) the higher the sound volume, the lower the battery lenght,
5) TLP saves more battery than laptop-mode by default,
6) TLP does not need additional tuning to make its job,
7) Laptop-mode causes problems with suspend/hibernate,
8) Powertop will show you the power leaks in your system.

More useful ways that may help to save battery (please, don't expect miracles):
http://www.omgubuntu.co.uk/2016/04/impro...life-linux
https://wiki.ubuntu.com/Kernel/PowerMana...vingTweaks

Edit: I added your tweaking criteria to the 'Brainstorming for XanMod Kernel' topic.
https://forum.xanmod.org/thread-142-post...ml#pid2304

@tropic

1) Sure, standby time is a moving target.
2), 3), 4) very obvious
5) very subjective: results will vary per user per machine per linux flavour per usage etc etc
6) not true unless someone using bfq is happy for TLP to default to cfq on battery power (for 1 example)
7) not if configured properly
8) sure, powertop is in and of itself more useful than TLP or laptop-mode

I am not a salesman, so its fine for me what anyone else uses (i.e. I really don't care).  I have no vested interest in laptop-mode or TLP, I am merely trying to provide user experience for other users whom also may use "laptop-mode".

I though that was what this forum was for.
Reply

#6
@GWD72

Default Ubuntu's energy management is obvious enough for the average user.
There are more agressive energy saver options -- I don't recommend them:
https://help.ubuntu.com/community/PowerM...ducedPower

As far as I know about XanMod Kernel, we have never found any problem with energy management itself. 
However, TLP and Laptop-mode should not be able to change the I/O scheduler nor CPU frequency by default:
https://askubuntu.com/questions/455343/t...ing-effect
https://askubuntu.com/questions/556894/t...-frequency

Furthermore,"the changes we put into Precise 12.04 LTS pm-utils /usr/lib/pm-utils/power.d address a lot of the best low-risk power savings for a broad range of machines based on some in-depth analysis with a high precision multimeter. These scripts cover power savings using hdparm, Intel Audio powersavings, PCI device power savings, PCI-e ASPM, USB bluetooth, SATA ALPM, Wireless, scheduler tweaks and VM dirty page settings. I suspect these changes in 12.04 are a little more comprehensive than the laptop-mode-utils." (...) "I decided to remove laptop-mode-tools as it shouldn't make any difference according to what I read here (and it caused problems when shutting down whitout my laptop being plugged in) (...)".
https://askubuntu.com/questions/172391/i...-x-kernels
All suggestions are kindly welcome here! Smile
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#7
(12-07-2017, 01:46 PM)tropic Wrote: @GWD72

Default Ubuntu's energy management is obvious enough for the average user.
There are more agressive energy saver options -- I don't recommend them:
https://help.ubuntu.com/community/PowerM...ducedPower

As far as I know about XanMod Kernel, we have never found any problem with energy management itself. 
However, TLP and Laptop-mode should not be able to change the I/O scheduler nor CPU frequency by default:
https://askubuntu.com/questions/455343/t...ing-effect
https://askubuntu.com/questions/556894/t...-frequency

Furthermore,"the changes we put into Precise 12.04 LTS pm-utils /usr/lib/pm-utils/power.d address a lot of the best low-risk power savings for a broad range of machines based on some in-depth analysis with a high precision multimeter. These scripts cover power savings using hdparm, Intel Audio powersavings, PCI device power savings, PCI-e ASPM, USB bluetooth, SATA ALPM, Wireless, scheduler tweaks and VM dirty page settings. I suspect these changes in 12.04 are a little more comprehensive than the laptop-mode-utils." (...) "I decided to remove laptop-mode-tools as it shouldn't make any difference according to what I read here (and it caused problems when shutting down whitout my laptop being plugged in) (...)".
https://askubuntu.com/questions/172391/i...-x-kernels
All suggestions are kindly welcome here! Smile

@tropic

Have I misunderstood the man pages of TLP?  I admit it is possible.

from: http://linrunner.de/en/tlp/docs/tlp-configuration.html

"Disk I/O Scheduler
DISK_IOSCHED="deadline cfq"
Sets the I/O scheduler per disk. Possible values:
    cfq – Linux default, works well with both conventional HDDs and SSDs
    deadline – Linux default (newer kernels), works well with both conventional HDDs and SSDs
    noop
    bfq – recently proposed scheduler (needs custom kernel)
    keep – special value to use the kernel default scheduler for the particular disk (synonym: _)

So, TLP knows the system scheduler without the user needing to specify? (an honest question not a challenge!)
Reply

#8
@GWD72
At least for me, TLP doesn't override the I/O scheduler (nor the governor) by default. This is useful in some way because it lets me to select them according to the task that is being done. However, as I said in former posts, the common sense is the better choice: using headphones, lower screen bright, XCFE desktop, WiFi save-mode, CFQ I/O scheduler and powersave governor gives me the better battery saving measures, whatever the TLP/Laptop-mode values suggested. Again, current 16.04 Ubuntu's power management default options are mostly enough for the average system, and 18.04 is expected to be in the same way. However, we should not forget that XanMod kernel is a highly tweaked kernel for the average user with the current best balanced energy consumption. Sleepy

Edit: as I said before, I have added your tweaking criteria to the 'Brainstorming for XanMod Kernel' topic.
https://forum.xanmod.org/thread-142-post...ml#pid2304
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply



[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump:


Users browsing this thread:
1 Guest(s)