Skip to content
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

Merged
merged 5 commits into from Sep 2, 2018
Merged

lenovo/thinkpad/x260: Init #70

merged 5 commits into from Sep 2, 2018

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Aug 13, 2018

Added a profile for x260.

  • TLP config includes a fix for BTRFS(the first line), which e.g. is not present in config for x1 6th gen. AFAIK this should not influence the performance too much, yet it should prevent possible bugs/data corruption, which BTRFS users may encounter otherwise, hence I think it's a good idea to put it there.
  • While working on this I noticed that most of the other ThinkPad profiles do not include the 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.
  • Maybe it would be a good idea to extract the TLP config into a (shared) function, which would generate powersaving config given the battery count?


# 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
Copy link
Member

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.

START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=80
Copy link
Member

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?

Copy link
Member Author

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.

STOP_CHARGE_THRESH_BAT1=80

CPU_SCALING_GOVERNOR_ON_BAT=powersave
ENERGY_PERF_POLICY_ON_BAT=powersave
Copy link
Member

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?

Copy link
Member Author

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:

CPU_SCALING_GOVERNOR_ON_BAT=powersave
ENERGY_PERF_POLICY_ON_BAT=powersave

@Mic92
Copy link
Member

Mic92 commented Aug 17, 2018

@yegortimoshenko anything that needs to be done here?


CPU_SCALING_GOVERNOR_ON_BAT=powersave
ENERGY_PERF_POLICY_ON_BAT=powersave
'';
Copy link
Member

@lukateras lukateras Aug 25, 2018

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.

@rvolosatovs
Copy link
Member Author

@yegortimoshenko rebased and addressed your comment


# https://wiki.archlinux.org/index.php/TLP#Btrfs
services.tlp.extraConfig = ''
SATA_LINKPWR_ON_BAT=max_performance
Copy link
Member

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?

Copy link
Member

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?

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants