New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lenovo/thinkpad/x260: Init #70
Conversation
lenovo/thinkpad/x260/default.nix
Outdated
|
||
# See https://linrunner.de/en/tlp/docs/tlp-faq.html#battery https://wiki.archlinux.org/index.php/TLP#Btrfs | ||
services.tlp.extraConfig = '' | ||
SATA_LINKPWR_ON_BAT=max_performance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! We should probably apply this for all profiles, not just ThinkPad X260.
lenovo/thinkpad/x260/default.nix
Outdated
START_CHARGE_THRESH_BAT0=75 | ||
STOP_CHARGE_THRESH_BAT0=80 | ||
START_CHARGE_THRESH_BAT1=75 | ||
STOP_CHARGE_THRESH_BAT1=80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that specific to this model? Is the rationale to save up battery charge cycles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here
Factory settings for ThinkPad battery thresholds are as follows: when plugged in the battery starts charging at 96%, and stops at 100%. These settings are optimized for maximum runtime, but having a battery hold a lot of power will decrease its capacity over the years. To alleviate this problem, the start/stop charge thresholds can be adjusted – at the cost of a more or less reduced battery runtime.
These values are rather conservative defaults from the TLP manual.
lenovo/thinkpad/x260/default.nix
Outdated
STOP_CHARGE_THRESH_BAT1=80 | ||
|
||
CPU_SCALING_GOVERNOR_ON_BAT=powersave | ||
ENERGY_PERF_POLICY_ON_BAT=powersave |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, apparently that's not a default. Maybe let's make it into one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by this?
Also, note that the same settings are used for X1 Carbon in current master
:
nixos-hardware/lenovo/thinkpad/x1/6th-gen/default.nix
Lines 25 to 26 in d534770
CPU_SCALING_GOVERNOR_ON_BAT=powersave | |
ENERGY_PERF_POLICY_ON_BAT=powersave |
d36e621
to
9157bfd
Compare
@yegortimoshenko anything that needs to be done here? |
c952562
to
fd2a90e
Compare
lenovo/thinkpad/x260/default.nix
Outdated
|
||
CPU_SCALING_GOVERNOR_ON_BAT=powersave | ||
ENERGY_PERF_POLICY_ON_BAT=powersave | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this config on i7-6500U CPU laptop (Purism Librem 13v3) for several days, which is the same CPU generation that X260 comes with (Skylake), but supposedly somewhat more performant. Unfortunately, this config (specifically, CPU_SCALING_GOVERNOR_ON_BAT=powersave
and ENERGY_PERF_POLICY_ON_BAT=powersave
) causes severe performance degradation to the point where, e.g. GNOME would not run smoothly anymore.
As of charge thresholds, that seems to be opinionated as well, and I can see other people (myself included) would like to leverage full battery capacity instead. So maybe let's stick with TLP defaults on that as well.
fd2a90e
to
ac7fac7
Compare
@yegortimoshenko rebased and addressed your comment |
lenovo/thinkpad/x260/default.nix
Outdated
|
||
# https://wiki.archlinux.org/index.php/TLP#Btrfs | ||
services.tlp.extraConfig = '' | ||
SATA_LINKPWR_ON_BAT=max_performance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a discussion on this: https://wiki.archlinux.org/index.php/Talk:TLP#Btrfs
Should we make only enable this on kernel lower then 4.15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this reproducible with any other file system then BTRFS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mic92 I think we can set it to med_power_with_dipm
on all laptops starting with 4.15 kernels, just in case.
6774337
to
5f6e8ce
Compare
5f6e8ce
to
6ed4fea
Compare
Added a profile for x260.
acpi_call
, which is required, e.g. for TLP to work. Did not include the fixes, as that is out of scope of this PR.