wcpufreq CPU Frequency Scaling 1.1

Miscellaneous tools
Message
Author
User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#41 Post by Marv »

ally wrote:lenovo x230 running xenialpup64, unable to set scaling using either 0.8x or 1.2

:)
Hi ally, What is packaged with xenialPup64 wrt setting cpu freq? I don't have a copy downloaded to check. Were you able to set with that? When the versions above failed what did you see... were any governors displayed etc?

Update: I just downloaded and installed Battleshooters XFCE_XenialPup64 r2 and booted into it. The stock version of wcpufreq in /usr/sbin is the same as the unpatched 0.8 version above. I set several governors with it on my i5 laptop and then manually copied in the patched 0.8.1. Able to install and change governors with that as well. The patch for the 4.13 and newer kernels is invoked as the kernel is 4.13.0 on this install and my core speeds are correctly displayed. Crosschecked that with the unpatched PupSysInfo in this install and indeed it displays the cpu speed incorrectly. Could it be a hardware issue? If so we need to pursue it.

:idea: Do you see Intel_Pstate as your governor? If so, to use the acpi_cpufreq governors you need to pass intel_pstate=disable as a kernel parameter to disable the intel governor. Otherwise it takes precedence.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#42 Post by ally »

hi marv

yes to Intel_Pstate, set to performance and unable to modify I will try the kernel switch and report back

:)

edit: kernel parameter added to menu.1st, now able to run cpu scaling...nice!

thank you

:)

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#43 Post by Marv »

Great.

Maybe we can test for the Intel_Pstate governor in wcpufreq 1.2 and put a note in to that effect.

I cobbled in an explicit intel_pstate warning to 1.2. Tain't especially pretty yet but I think it is fairly clear. I've tested it in Battleshooters XFCE_XenialPup64 r2 by toggling the kernel parameter and both cases seem ok. I also added support for the cpu current frequency when in intel_pstate. It writes to a different file in the sysfs. I'll attach the script labelled as 1.2a and a diff from 1.2 below. Try it and pretty it up please. Both files are true gzips.

Update: 1.2b does two things. One is (as 1.2a) to support the reading of current speeds from the intel_pstate driver and the other is to clean up a bit (I think) the warning/instructions wrt that driver. I'll replace the 1.2a with it below and pull the diff since there were 0 downloads.

Edit on 5 December 2017: Based on comments and kernel changes 4.13 support pulled and only intel_pstate support added.
Attachments
wcpufreq.gz
updated 1.2b. intel_pstate support added. Speed and a warning. Kernel 4.13 support pulled.
(7.83 KiB) Downloaded 159 times
Last edited by Marv on Wed 06 Dec 2017, 04:00, edited 1 time in total.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

intel core iX

#44 Post by Anniekin »

Hi
Last edited by Anniekin on Tue 05 Dec 2017, 23:27, edited 1 time in total.

User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

intel core iX

#45 Post by Anniekin »

I'm stupid
Last edited by Anniekin on Tue 05 Dec 2017, 23:27, edited 1 time in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#46 Post by BarryK »

Um, I have wcpufreq 0.8.3, dated 2015:

http://distro.ibiblio.org/easyos/noarch ... -0.8.3.pet

I found my blog post about it:

http://bkhome.org/news/201511/wcpufreq-083.html

So, it looks like I have to patch it for the 4.13.x kernel, and probably bump the version to 0.8.4.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#47 Post by BarryK »

BarryK wrote:Um, I have wcpufreq 0.8.3, dated 2015:

http://distro.ibiblio.org/easyos/noarch ... -0.8.3.pet

I found my blog post about it:

http://bkhome.org/news/201511/wcpufreq-083.html

So, it looks like I have to patch it for the 4.13.x kernel, and probably bump the version to 0.8.4.
Checked the PETs, that 0.8.2 is not internationalised, my 0.8.3 is, that is the main difference.

So, is this the only change required to support 4.13 kernel?:

Code: Select all

KERNEL_VER=$(uname -r | cut -f1,2 -d'.')  #170921
	if ((`bc <<< "$KERNEL_VER>=4.13"`)); then
	 CPU_INFO_SPEED=$(sed 's/...$//' /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq)
	else
     CPU_INFO_SPEED="`cat /proc/cpuinfo | grep 'MHz' | awk '{print $4}' | cut -f 1 -d '.'`"
    fi
EDIT:

Huh?! :?

I am running with the 4.14.1 kernel, and both of those above methods work. In other words, there is no need for the patch.
[url]https://bkhome.org/news/[/url]

User avatar
Anniekin
Posts: 246
Joined: Wed 25 Feb 2009, 00:15

#48 Post by Anniekin »

so, like this?

kernel /xenialpup647.5frugal/vmlinuz psubdir=xenialpup647.5frugal pmedia=atahd pfix=fsck intel_pstate=disable

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#49 Post by BarryK »

Marv wrote:Great.

Maybe we can test for the Intel_Pstate governor in wcpufreq 1.2 and put a note in to that effect.

I cobbled in an explicit intel_pstate warning to 1.2. Tain't especially pretty yet but I think it is fairly clear. I've tested it in Battleshooters XFCE_XenialPup64 r2 by toggling the kernel parameter and both cases seem ok. I also added support for the cpu current frequency when in intel_pstate. It writes to a different file in the sysfs. I'll attach the script labelled as 1.2a and a diff from 1.2 below. Try it and pretty it up please. Both files are true gzips.

Update: 1.2b does two things. One is (as 1.2a) to support the reading of current speeds from the intel_pstate driver and the other is to clean up a bit (I think) the warning/instructions wrt that driver. I'll replace the 1.2a with it below and pull the diff since there were 0 downloads.
Marv,
This code seems to be broken:

Code: Select all

KERNEL_VER=$(uname -r | cut -f1,2 -d'.')  #170921
	if ((`bc <<< "$KERNEL_VER>=4.13"`)); then
	 if [ $CPU_DRIVER = "intel_pstate" ]; then
	    CPU_INFO_SPEED=$(sed 's/...$//' /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq)
	  else 
	   CPU_INFO_SPEED=$(sed 's/...$//' /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq)
	 fi
	else
     CPU_INFO_SPEED="`cat /proc/cpuinfo | grep 'MHz' | awk '{print $4}' | cut -f 1 -d '.'`"
    fi
...as CPU_DRIVER is not set that early in the script.

Not that it matters, as the two lines computing CPU_INFO_SPEED seem to be the same.

I will put updating to 0.8.4 on hold for now, give you guys time to look at it.
Last edited by BarryK on Tue 05 Dec 2017, 23:51, edited 1 time in total.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#50 Post by BarryK »

An extra note. This line:

Code: Select all

if ((`bc <<< "$KERNEL_VER>=4.13"`)); then


Can be replaced with:

Code: Select all

if vercmp $KERNEL_VER ge 4.13; then
I think all pups, going back quite a while, have the vercmp utility. No need for those braces and backticks either.
[url]https://bkhome.org/news/[/url]

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

#51 Post by Marv »

BarryK wrote:
BarryK wrote:Um, I have wcpufreq 0.8.3, dated 2015:

http://distro.ibiblio.org/easyos/noarch ... -0.8.3.pet

I found my blog post about it:

http://bkhome.org/news/201511/wcpufreq-083.html

So, it looks like I have to patch it for the 4.13.x kernel, and probably bump the version to 0.8.4.
Checked the PETs, that 0.8.2 is not internationalised, my 0.8.3 is, that is the main difference.

So, is this the only change required to support 4.13 kernel?:

Code: Select all

KERNEL_VER=$(uname -r | cut -f1,2 -d'.')  #170921
	if ((`bc <<< "$KERNEL_VER>=4.13"`)); then
	 CPU_INFO_SPEED=$(sed 's/...$//' /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq)
	else
     CPU_INFO_SPEED="`cat /proc/cpuinfo | grep 'MHz' | awk '{print $4}' | cut -f 1 -d '.'`"
    fi
EDIT:

Huh?! :?

I am running with the 4.14.1 kernel, and both of those above methods work. In other words, there is no need for the patch.
Yes, that is correct pre or post 4.13. The 4.14 kernel reverted to the pre-4.13 kernel behavior. It again writes the current CPU speed to /proc/cpuinfo. A warning in wcpufreq that wcpufreq will not work if intel_pstate is enabled in the kernel and not disabled by passing a kernel parameter still might forestall some questions IMO. I am watching the thread but there had been no responses since 22 Sept so I figured it was a dead horse.

Edit: I'll update my posting above with a version with support and warning for intel_pstate only. Again, for testing and comments. CPU_DRIVER is set by the time the relevant function is called, I echoed it initially to check.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#52 Post by BarryK »

Marv,
Thanks for that info.

My 4.14.1 kernel is configured with:

Code: Select all

# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set

#
# CPU frequency scaling drivers
#
# CONFIG_X86_INTEL_PSTATE is not set
# CONFIG_X86_PCC_CPUFREQ is not set
CONFIG_X86_ACPI_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ_CPB=y
CONFIG_X86_POWERNOW_K8=m
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
CONFIG_X86_SPEEDSTEP_CENTRINO=m
CONFIG_X86_P4_CLOCKMOD=m

#
# shared options
#
CONFIG_X86_SPEEDSTEP_LIB=m
Kernel source, patches, build scripts here:

http://distro.ibiblio.org/easyos/source/kernel/4.14.1/

So, looks like I don't have to worry about that intel_pstate, in my Quirky and Easy builds. So, my 0.8.3 is ok as-is, but I will put in that patch for 4.13.x.
[url]https://bkhome.org/news/[/url]

Post Reply