LinuxQuestions.org
Visit Jeremy's Blog.
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 09-10-2018, 07:20 AM   #76
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237

Quote:
Originally Posted by abga View Post
With all the feedback about this change I started to get worried about the use of mobile computers while on batteries with the default CPU governor configured on ondemand or performance, due to the increased power consumption of the CPU.

FYI: After reading this thread, having similar worries, I tested my Celeron N3050 (Braswell) laptop in battery mode and compared powersave (which equals ondemand in this case) against performance, using powertop for measurements. There was no statistically significant difference. Thus I decided to set the default to performance.
 
Old 09-10-2018, 08:01 AM   #77
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 Ilgar View Post
FYI: After reading this thread, having similar worries, I tested my Celeron N3050 (Braswell) laptop in battery mode and compared powersave (which equals ondemand in this case) against performance, using powertop for measurements. There was no statistically significant difference. Thus I decided to set the default to performance.
Thanks for your feedback on this. The CPU is the only component that uses a significant amount of power and by tuning it from OS level (PM driver & governor) it doesn't use its own autonomous PM (+BIOS) anymore.
The intel_pstate powersave governor shouldn't actually be considered the equivalent for the acpi-cpufreq ondemand, that's why this thread was started. It also depends on specific CPU implementation of the P-States and more importantly C-states, that intel_pstate->powersave makes use of to put the CPU in some deep sleep modes. Your CPU, which is not that "sophisticated" and more of an "entry level" type might not have many of these PM enhancements.
Also thanks for pointing to powertop, never used it actually and wondering how accurate it is in estimating the power consumption for a CPU like yours that has a TDP/SDP of 6W/4W:
https://github.com/fenrus75/powertop

A question, while setting the intel_pstate on performance on your Celeron, have you noticed any dynamic change/scaling of the CPU frequency and what was the CPU fan doing, was it stopping during idle periods?

Last edited by abga; 09-10-2018 at 08:04 AM. Reason: typo
 
Old 09-10-2018, 10:38 AM   #78
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Darth Vader View Post
Faulty or not, snail-ish or not, that "ondemand" governor brings up a functional system.
On Intel systems using the intel_pstate driver, ondemand is not a valid governor, so using it on an intel_pstate based system is not "functional". The changes that have been made keep ondemand as the default governor for all systems unless they're using the intel_pstate driver.
 
1 members found this post helpful.
Old 09-10-2018, 01:25 PM   #79
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
Quote:
Originally Posted by abga View Post
A question, while setting the intel_pstate on performance on your Celeron, have you noticed any dynamic change/scaling of the CPU frequency and what was the CPU fan doing, was it stopping during idle periods?
I didn't check the frequencies, and this laptop has no fan. You are right about the remark on the accuracy of the measurement, given that the CPU power consumption is so low (almost always <4W, ~2.7W when idle). Indeed, in my case screen brightness matters almost as much as high CPU load. Still, I can say that I found powertop's estimates for remaining battery time to be fairly accurate, so it must be measuring the power consumption reasonably well (at least on my hardware).
 
Old 09-10-2018, 02:17 PM   #80
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 272
Blog Entries: 2

Rep: Reputation: 85
Just an FYI: tools like TLP [1] exist for setting tunables for optimum battery life. Available on SBo [2].

[1]: https://github.com/linrunner/TLP
[2]: https://slackbuilds.org/repository/14.2/system/TLP/

Last edited by aaditya; 09-10-2018 at 02:41 PM. Reason: add sbo link
 
1 members found this post helpful.
Old 09-10-2018, 02:44 PM   #81
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by bassmadrigal View Post
On Intel systems using the intel_pstate driver, ondemand is not a valid governor, so using it on an intel_pstate based system is not "functional". The changes that have been made keep ondemand as the default governor for all systems unless they're using the intel_pstate driver.
It is "functional" as the system does not crash by its fault and the box is up and running. That it is not also maybe "optimal", that's another story.

Anyway, even in the past was the ability to edit the wanted governor...
 
Old 09-10-2018, 03:14 PM   #82
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by aaditya View Post
Just an FYI: tools like TLP [1] exist for setting tunables for optimum battery life. Available on SBo [2].

[1]: https://github.com/linrunner/TLP
[2]: https://slackbuilds.org/repository/14.2/system/TLP/
Awesome aaditya !

I have been lurking on this thread but didn't have anything to say so I didn't

Thanks for the link !

Gotta try TLP on my work LapTop !

-- kjh

TLP builds easily and has no deps ( other than rc.acpid as mentioned in the README.Slackware ).

Code:
# ver TLP

-rw-r--r-- 1 root root 1839 Sep 10 15:11 /var/log/packages/TLP-1.1-x86_64-1_SBo
Code:
# ./.get-SB-info TLP

##################################################
# /home/dld/slackbuilds/14.2/system/TLP/TLP.info #
##################################################

PRGNAM="TLP"
VERSION="1.1"
HOMEPAGE="https://github.com/linrunner/TLP"
DOWNLOAD="http://github.com/linrunner/TLP/archive/1.1.tar.gz"
MD5SUM="02c13e8023317e2e2df4742129ecee56"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Aaditya Bagga"
EMAIL="aaditya_gnulinux@xxx.tld"         # changed it
Code:
# ./.get-SB-readme TLP

##########################################################
# /home/dld/slackbuilds/14.2/system/TLP/README.Slackware #
##########################################################

Post installation steps:

# Give execute permission to rc.tlp
chmod +x /etc/rc.d/rc.tlp

# Start the tlp service
/etc/rc.d/rc.tlp start

# Restart acpid
/etc/rc.d/rc.acpid restart

# Configure tlp to be run at startup
add "/etc/rc.d/rc.tlp start" (without quotes) to /etc/rc.d/rc.local

After removal of this package you would need to revert the above
changes.  Please make sure that you stopped the TLP service before
removing TLP.

If you have enabled any hooks in /usr/lib/pm-utils/power.d/ (they are
disabled by default), then the instructions given in the TLP developer
documentation can be followed.
http://linrunner.de/en/tlp/docs/tlp-developer-documentation.html#installscripts

################################################
# /home/dld/slackbuilds/14.2/system/TLP/README #
################################################

TLP implements advanced power management for Linux.
TLP is a pure command line tool with automated background tasks.
It does not contain a GUI.

Notes:
Remove any power saving settings/scripts (e.g.: in /etc/rc.local) or
laptop-mode-tools prior installing or TLP may not work properly

See README.SLACKWARE for more information about post-installation script

An additional configuration is available for Thinkpads.
See the website for more details.
http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
 
1 members found this post helpful.
Old 09-10-2018, 03:57 PM   #83
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
@kjhambrick

I would be a little more careful when playing with the PM on the I/O subsystem and the connectivity interfaces, some of these don't like being "resurrected". On modern systems the majority of components have already their own autonomous PM (collaboration/orchestration(tuning) with/from the BIOS). The only one I'd focus on, mainly because its PM is left at the control of the OS/user (PM driver acpi-cpufreq & intel_pstate with their corresponding governors) would be the CPU. Taking care of it looks to be pretty simple with the help of acpid, as I myself learned and documented in post #71

Check:
https://github.com/linrunner/TLP/blob/master/README
&
https://github.com/linrunner/TLP/issues
 
1 members found this post helpful.
Old 09-10-2018, 04:40 PM   #84
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks abga.

I'll definitely be careful with it.

I learned a long time ago to not commit any changes to /etc/rc.d/ until I've tested them manually from the commandline.

Avoid a lot of heartache that-a-way

-- kjh
 
Old 09-10-2018, 05:22 PM   #85
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Darth Vader View Post
It is "functional" as the system does not crash by its fault and the box is up and running. That it is not also maybe "optimal", that's another story.
I think Intel screwed up only providing two governors for their processors using intel_pstate, but that is my opinion and I'm sure hopeful they have good reasons for it.

Quote:
Originally Posted by Darth Vader View Post
Anyway, even in the past was the ability to edit the wanted governor...
Did you read the file before you stated that you can't run your own governor? It certainly doesn't seem like it, because you can have your own governor set in a multitude of ways...

Code:
#!/bin/sh
#
# rc.cpufreq:  Settings for CPU frequency and voltage scaling in the kernel.
#              For more information, see the kernel documentation in
#              /usr/src/linux/Documentation/cpu-freq/


# Default CPU scaling governor to try.  Some possible choices are:
# performance:  The CPUfreq governor "performance" sets the CPU statically
#             to the highest frequency within the borders of scaling_min_freq
#             and scaling_max_freq.
# powersave:  The CPUfreq governor "powersave" sets the CPU statically to the
#             lowest frequency within the borders of scaling_min_freq and
#             scaling_max_freq.
# userspace:  The CPUfreq governor "userspace" allows the user, or any
#             userspace program running with UID "root", to set the CPU to a
#             specific frequency by making a sysfs file "scaling_setspeed"
#             available in the CPU-device directory.
# ondemand:   The CPUfreq governor "ondemand" sets the CPU depending on the
#             current usage.
# conservative:  The CPUfreq governor "conservative", much like the "ondemand"
#             governor, sets the CPU depending on the current usage.  It
#             differs in behaviour in that it gracefully increases and
#             decreases the CPU speed rather than jumping to max speed the
#             moment there is any load on the CPU.
# schedutil:  The CPUfreq governor "schedutil" aims at better integration with
#             the Linux kernel scheduler. Load estimation is achieved through
#             the scheduler's Per-Entity Load Tracking (PELT) mechanism, which
#             also provides information about the recent load.
SCALING_GOVERNOR=ondemand

# For CPUs using intel_pstate, always use the performance governor. This also
# provides power savings on Intel processors while avoiding the ramp-up lag
# present when using the powersave governor (which is the default if ondemand
# is requested on these machines):
if [ "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2> /dev/null)" = "intel_pstate" ]; then
  SCALING_GOVERNOR="performance"
fi

# If rc.cpufreq is given an option, use it for the CPU scaling governor instead:
if [ ! -z "$1" -a "$1" != "start" ]; then
  SCALING_GOVERNOR=$1
fi

# To force a particular option without having to edit this file, uncomment the
# line in /etc/default/cpufreq and edit it to select the desired option:
if [ -r /etc/default/cpufreq ]; then
  . /etc/default/cpufreq
fi

# If you need to load a specific CPUFreq driver, load it here.  Most likely you don't.
#/sbin/modprobe acpi-cpufreq

# 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.
echo $SCALING_GOVERNOR | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 1> /dev/null 2> /dev/null

# Report what CPU scaling governor is in use after applying the setting:
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
  echo "Enabled CPU frequency scaling governor:  $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)"
fi

unset SCALING_GOVERNOR
If you can make it through that file, you'll see several ways to set your own governor. Each item below is overridden by the next one if it is set, so keep that in mind.
  1. Set SCALING_GOVERNOR to your desired governor in rc.cpufreq (processors using intel_pstate will have this option, and only this option, overridden)
  2. Pass the specific governor to rc.cpufreq (either edit rc.M and replace "start" with the governor or call it again in rc.local)
  3. Create/edit /etc/default/cpufreq and have SCALING_GOVERNOR set to whatever governor you want

By default, for ALL CPUs except for ones running intel_pstate, the default governor is ondemand.

Last edited by bassmadrigal; 09-10-2018 at 05:23 PM.
 
Old 09-10-2018, 05:28 PM   #86
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by bassmadrigal View Post
Did you read the file before you stated that you can't run your own governor? It certainly doesn't seem like it, because you can have your own governor set in a multitude of ways...
I know well the current script, AND I talked about the script from before all those changes.

AND, contrary what you say, I claim that was quite possible to chose the wanted governor and was very simple.

Was (from long time) as simple as changing into "/etc/rc.d/rc.cpufreq"
Code:
SCALING_GOVERNOR=performance
Complicated, huh?

AND, I for one I believe what is worth from those recent changes is just that default config, aka "/etc/default/cpufreq"

The rest is nitpicking and only goods known what. Probably some people has too much time on their hands, and love to invent work for our BDFL too.

Last edited by Darth Vader; 09-10-2018 at 06:33 PM.
 
Old 09-10-2018, 11:49 PM   #87
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 272
Blog Entries: 2

Rep: Reputation: 85
Quote:
Originally Posted by kjhambrick View Post
Awesome aaditya !

I have been lurking on this thread but didn't have anything to say so I didn't

Thanks for the link !

Gotta try TLP on my work LapTop !

-- kjh
Thank you for your kind words, kjhambrick :-)

I have been lurking around too, this thread has been very informative.

Using TLP for more than 3 years now without noticing any adverse effects. Here are some defaults from its config file:

Code:
# Set CPU performance versus energy savings policy:
#   performance, balance-performance, default, balance-power, power.
# Values are given in order of increasing power saving.
# Requires kernel module msr and x86_energy_perf_policy from linux-tools.
ENERGY_PERF_POLICY_ON_AC=performance
ENERGY_PERF_POLICY_ON_BAT=power

# Disk devices; separate multiple devices with spaces (default: sda).
# Devices can be specified by disk ID also (lookup with: tlp diskid).
DISK_DEVICES="sda sdb"

# Disk advanced power management level: 1..254, 255 (max saving, min, off).
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple disks with spaces. Use the special value 'keep'
# to keep the hardware default for the particular disk.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"

# Hard disk spin down timeout:
#   0:        spin down disabled
#   1..240:   timeouts from 5s to 20min (in units of 5s)
#   241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
# Separate values for multiple disks with spaces. Use the special value 'keep'
# to keep the hardware default for the particular disk.
#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"

# Select IO scheduler for the disk devices: cfq, deadline, noop (Default: cfq).
# Separate values for multiple disks with spaces. Use the special value 'keep'
# to keep the kernel default scheduler for the particular disk.
#DISK_IOSCHED="cfq cfq"

# AHCI link power management (ALPM) for disk devices:
#   min_power, med_power_with_dipm(*), medium_power, max_performance.
# (*) Kernel >= 4.15 required, then recommended.
# Multiple values separated with spaces are tried sequentially until success.
SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"
With the default config laptop is responsive even on battery, with increase in battery life of around 1.5 hours.

YMMV.

P.S.
powertop can be used to check power consumption and tunables.

Edit-
https://linrunner.de/en/tlp/docs/tlp-faq.html

Last edited by aaditya; 09-11-2018 at 12:06 AM. Reason: add tlp faq link
 
3 members found this post helpful.
Old 09-11-2018, 10:06 AM   #88
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Darth Vader View Post
The rest is nitpicking and only goods known what.
So, you're complaining that Intel chips (which I don't even know if you own any... I think they're all AMD) have a different governor than others because the default, ondemand, isn't actually supported by the latest Intel chips?
 
Old 09-11-2018, 10:20 AM   #89
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,816

Rep: Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981
Feedback:
My relative's computer with a 6700K processor is a bit unstable. Windows 7 crashes it and Windows 10 can't be installed because the computer blue screens halfway through the installation. It froze with the CPU governor set to "performance." It has never done this before. It has poor cooling. One core was running 66 C. When its set to "ondemand" the cores are below 40 C.
 
1 members found this post helpful.
Old 09-11-2018, 11:02 AM   #90
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 RadicalDreamer View Post
Feedback:
My relative's computer with a 6700K processor is a bit unstable. Windows 7 crashes it and Windows 10 can't be installed because the computer blue screens halfway through the installation. It froze with the CPU governor set to "performance." It has never done this before. It has poor cooling. One core was running 66 C. When its set to "ondemand" the cores are below 40 C.
As I understand it, your relative's CPU is "a bit unstable" and has "poor cooling". Setting the governor on performance should not be persistent after a reboot, I can't follow your situation there.
How did you set it ondemand? Have you blacklisted the intel_pstate driver providing the kernel boot parameter intel_pstate=disable ?
 
  


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
CPU frequency governor configuration yanf81 Linux - Software 12 11-15-2015 12:03 PM
LXer: Samsung Introduces "LAB" Linux Frequency Governor LXer Syndicated Linux News 0 04-10-2013 04:31 AM
[SOLVED] compiz fusion " cpu frequency scaling unsupported" mad11 Linux - Newbie 0 03-19-2010 07:10 AM
[SOLVED] Using the "powersave" governor on battery and "ondemand" governor on AC power piratesmack Slackware 5 01-21-2010 12:54 PM
"CPU frequency is not supported and system is very very slow" kandhakumar Linux - General 3 06-29-2008 06:25 AM

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

All times are GMT -5. The time now is 06:34 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