LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-17-2019, 09:36 PM   #16
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40

So far so good - I left the laptop for ~7 hours on (no load), and the battery was drained just a bit (still 39% full built in, and 79% external).
 
Old 07-17-2019, 10:35 PM   #17
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
CPU temperature is also fine:
Code:
Package id 0:  +36.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +36.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +36.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +35.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +35.0°C  (high = +100.0°C, crit = +100.0°C)
 
Old 07-18-2019, 03:14 PM   #18
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
I also suggest this page, as the new Intel's performance scaling technology is well explained:

https://www.kernel.org/doc/html/v4.1...el_pstate.html
 
1 members found this post helpful.
Old 07-19-2019, 10:05 PM   #19
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 297

Rep: Reputation: Disabled
Lenovo X250 here and -current.

Take a look on this: https://gist.github.com/denydias/3af...ed217f7b4d1c97

I also have this /etc/pm/power.d/cpufreq:

Code:
#!/bin/sh

# Default value on battery [$1 = "true"]
SCALING_GOVERNOR_BAT="powersave"

# Default value on AC [$1 = "false"]
SCALING_GOVERNOR_AC="performance"

set_cpufreq() {
  case $1 in
    bat) SCALING_GOVERNOR=$SCALING_GOVERNOR_BAT;;
    ac) SCALING_GOVERNOR=$SCALING_GOVERNOR_AC;;
  esac
  printf "Setting CPU frequency scaling governor to %s..." "$SCALING_GOVERNOR"
  echo $SCALING_GOVERNOR | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 1> /dev/null 2> /dev/null
  [ "$?" -eq 0 ] && echo Done. || echo Failed.
}

case $1 in
  true) set_cpufreq bat;;
  false) set_cpufreq ac;;
  *) exit $NA;;
esac

exit 0
As for the batteries mine drain the internal 3-cell first, then moves to external 6-cell. It always worked that way.

Last edited by denydias; 07-19-2019 at 10:32 PM.
 
2 members found this post helpful.
Old 07-21-2019, 09:28 PM   #20
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Hi denydias,

thanks for this script - I just had to change the way the governor is switched:
Code:
#!/bin/sh

# Default value on battery [$1 = "true"]
SCALING_GOVERNOR_BAT="powersave"

# Default value on AC [$1 = "false"]
SCALING_GOVERNOR_AC="performance"

set_cpufreq() {
  case $1 in
    bat) SCALING_GOVERNOR=$SCALING_GOVERNOR_BAT;;
    ac) SCALING_GOVERNOR=$SCALING_GOVERNOR_AC;;
  esac
  printf "Setting CPU frequency scaling governor to %s..." "$SCALING_GOVERNOR"
  pstate-frequency -S -g $SCALING_GOVERNOR
  [ "$?" -eq 0 ] && echo Done. || echo Failed.
}

case $1 in
  true) set_cpufreq bat;;
  false) set_cpufreq ac;;
  *) exit $NA;;
esac

exit 0
and now the governor is automatically changed when the power is plugged in or out.

I did some testing - compiling latest kernel from kernel.org - and it takes 5min 14sec with the 'powersave' governor, and 3min 59sec with the 'performance' governor.
 
3 members found this post helpful.
Old 07-21-2019, 10:58 PM   #21
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 297

Rep: Reputation: Disabled
Quote:
Originally Posted by ajevremovic View Post
thanks for this script - I just had to change the way the governor is switched:
You're welcome! I'm glad it gave you some ideias and have worked for you.
 
Old 07-31-2019, 07:37 PM   #22
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Update: added another NVMe drive to M.2 slot (WDC CL SN520 SDAPMUW-512G-1022, 2242). The drive temperature is 44 degrees Celsius (compared to ~35 degrees Celsius for built-in LITEON CA3-8D512 drive).

The speed is ~880MB/s:

Code:
bash-5.0# dd if=/dev/zero of=zero2 bs=1M count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.22188 s, 879 MB/s
 
1 members found this post helpful.
Old 08-06-2019, 05:53 PM   #23
lemonade
Member
 
Registered: Oct 2015
Posts: 40

Rep: Reputation: Disabled
Lightbulb its powersave (not ondemand)

governor should be powersave (not ondemand).

# Attempt to apply the CPU scaling governor setting. This may or may not
# actually override the default value depending on if the choice is supported
# by the architecture, processor, or underlying CPUFreq driver. For example,
# processors that use the Intel P-state driver will only be able to set
# performance or powersave here.
 
Old 08-11-2019, 12:30 AM   #24
Wiser Slacker
Member
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83

Rep: Reputation: Disabled
hi you may read this ...

https://www.linuxquestions.org/quest...ng-4175658943/
 
1 members found this post helpful.
Old 08-13-2019, 11:44 AM   #25
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Wiser Slacker View Post
Nice explanation for people interested to better understand this topic. Have you, maybe, tried to compare/benchmark speed and power efficiency when intel_pstate is enabled/disabled?
 
Old 08-14-2019, 10:40 AM   #26
Wiser Slacker
Member
 
Registered: May 2014
Location: germany
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83

Rep: Reputation: Disabled
Hi - you

I have tested these things witch i have presented there with an "Energy-Meter" with an Accuracy of +/- 0.5%

and the idle difference of my Computers has been around 1% when using powersave from CPUfreq or from intel so this is less
interesting ... other data could bee found on Phoronix ...

but the most interesting for me is that the intel p-state driver is JUST a SWITCH between two options - the upper OR the lower frequency range
so one could NOT change these ranges without MANUAL changig them - that may be interesting if you have got a laptop and a tool which did this SWITCH
but if you have a desktop or server - this should be done automaticaly when needed - that had been done for years by CPUfreq

but shocking had been the difference when running intel p-states with performance -> 25W
and the old kernel on the same machine - or the new kernel with 'intel_pstate=passive' and CPUfreq set to ondemand did just use -> 22W
this was 12% more energy -> 24/7/365 with intel p-states - just to stay in idle the most time ....

hope it helps
 
1 members found this post helpful.
Old 09-04-2019, 05:23 AM   #27
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
After some more research and tuning, I realized it's better to change the plan than the governor. So here is the updated /etc/pm/power.d/cpufreq script:
Code:
#!/bin/sh

# Default value on battery [$1 = "true"]
SCALING_PLAN_BAT="powersave"

# Default value on AC [$1 = "false"]
SCALING_PLAN_AC="balanced"

set_cpufreq() {
  case $1 in
    bat) SCALING_PLAN=$SCALING_PLAN_BAT;;
    ac) SCALING_PLAN=$SCALING_PLAN_AC;;
  esac
  printf "Setting CPU frequency scaling plan to %s..." "$SCALING_PLAN"
  /usr/local/bin/pstate-frequency -S -p $SCALING_PLAN
  [ "$?" -eq 0 ] && echo Done. || echo Failed.
}

case $1 in
  true) set_cpufreq bat;;
  false) set_cpufreq ac;;
  *) exit $NA;;
esac

exit 0
 
1 members found this post helpful.
Old 09-04-2019, 05:30 AM   #28
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
One more thing - since I reinstalled the system yesterday, and repeated all the steps described here, I noticed that cpu frequency scaling is not working until the TLP Linux Advanced Power Management (https://github.com/linrunner/TLP) is installed, despite the pstate-frequency being used.
 
1 members found this post helpful.
Old 09-05-2019, 12:59 PM   #29
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 297

Rep: Reputation: Disabled
Quote:
Originally Posted by ajevremovic View Post
until the TLP Linux Advanced Power Management (https://github.com/linrunner/TLP) is installed,
Thanks for pointing that out! I could remove some udev rules I had to save juice while running on batteries.

According to this faq, battery threshold for newer TP models should be disabled or have only start one set. As my TP is a X250, it fells into that recommendation so I've set it to:

Code:
$ grep CHARGE_THRESH_ /etc/default/tlp
START_CHARGE_THRESH_BAT0=75
#STOP_CHARGE_THRESH_BAT0=80
START_CHARGE_THRESH_BAT1=75
#STOP_CHARGE_THRESH_BAT1=80
How did you set your battery threshold?

Also I had to build and install acpi_call to fulfill TLP recommendations:

Code:
$ tlp-stat -b
--- TLP 1.2.2 --------------------------------------------

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = active (data, thresholds)
tpacpi-bat = active (recalibrate)
tp-smapi   = inactive (ThinkPad not supported)

$ grep -B2 TPSMAPI /etc/default/tlp
TPSMAPI_ENABLE=0
I've also tried to install to install tp_smapi, but it looks like X250 is not compatible with it so I removed it.

How does this compares to yours?

Last edited by denydias; 09-05-2019 at 01:22 PM.
 
Old 09-05-2019, 02:56 PM   #30
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by Wiser Slacker View Post
I'm focusing only on the Slackware forum and didn't see the Intel CPU Powersaving thread you started in Linux General.
You can disable the intel_pstate driver with a simple kernel boot parameter:
Code:
intel_pstate=disable
Then the kernel will pick the default (generic and old) acpi-cpufreq driver. But I wouldn't recommend it, because you'll loose some PM functionality, on the power saving side you could loose some deep PM states and on the performance side some frequency boosting.
There's also an autonomous PM system inside the Intel ME that is actually in control over the CPU PM regardless of the driver you're using.
In this pretty long thread you'll find some more info (look after my posts - I did provide a lot of references and docs):
https://www.linuxquestions.org/quest...or-4175637326/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thinpads - T480/T580, etc CPU throttling SqdnGuns Slackware 0 06-15-2018 06:45 AM
Set Clock Frequency on a Frequency Scaling Disabled Kernel mobin.seven Linux - Kernel 3 02-18-2017 10:33 PM
moved harddrive from t61 lenovo to t60 lenovo, now cpu freezes Peter Shepard Ubuntu 3 10-26-2009 06:11 PM
cpu frequency scaling with Pentium(R) Dual-Core CPU E5200 @ 2.50GHz tramni1980 Slackware 5 08-16-2009 08:29 AM
Curious to hear other people's experiences of the Thinkpad 240x nowhere.elysium Linux - Laptop and Netbook 1 01-15-2009 12:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration