LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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: 66

Original Poster
Rep: Reputation: 33

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: 66

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

Original Poster
Rep: Reputation: 33
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: 135

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: 66

Original Poster
Rep: Reputation: 33
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: 135

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: 66

Original Poster
Rep: Reputation: 33
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: 30

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
Posts: 69

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: 66

Original Poster
Rep: Reputation: 33
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
Posts: 69

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.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration