Jump to content
XPEnology Community

CPU Frequency scaling for DS918+


Trauma

Recommended Posts

2 hours ago, use-nas said:

Processor J3455, script

currtemp=$(cut -c 1-3 </sys/bus/platform/devices/coretemp.0/hwmon/hwmon0/temp1_input)

does not correctly display the temperature of 3 digits, so the processor is always in cooling mode.

currtemp=$(cut -c 1-2 </sys/bus/platform/devices/coretemp.0/hwmon/hwmon0/temp1_input)

now everything is OK))

Thanks for you're feedback. I'll need to know what kernel / model and DSM version you are using please.

Link to comment
Share on other sites

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0014, DMI type 4, 48 bytes
Processor Information
        Socket Designation: CPUSocket
        Type: Central Processor
        Family: Celeron
        Manufacturer: Intel
        ID: C9 06 05 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 92, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
        Voltage: 1.2 V
        External Clock: 100 MHz
        Max Speed: 2416 MHz
        Current Speed: 1500 MHz
        Status: Populated, Enabled
        Upgrade: Other
        L1 Cache Handle: 0x0012
        L2 Cache Handle: 0x0013
        L3 Cache Handle: Not Provided
        Serial Number: Not Specified
        Asset Tag: Fill By OEM
        Part Number: Fill By OEM
        Core Count: 4
        Core Enabled: 4
        Thread Count: 4
        Characteristics:
                64-bit capable

Link to comment
Share on other sites

trying to get this working on a 3622xs  7.1.0-U2  on a microservergen8 with a xeon E3 1265v2

 

If i modify in scaler.sh

 

# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }')

 

From 4-1 to 7 -1 ....nothing happens .... if i leave the default 4-1 , only 4 cores  show low freq.

 

Am i doing something wrong here ?

 

 

image.thumb.png.35bfc9b0fca3c34a1adca2bdbc6d6577.png

 

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0400, DMI type 4, 42 bytes
Processor Information
        Socket Designation: Proc 1
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: A9 06 03 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 58, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version:  Intel(R) Xeon(R) CPU E3-1265L V2 @ 2.50GHz
        Voltage: 1.4 V
        External Clock: 100 MHz
        Max Speed: 4800 MHz
        Current Speed: 2500 MHz
        Status: Populated, Enabled
        Upgrade: Socket BGA1155
        L1 Cache Handle: 0x0710
        L2 Cache Handle: 0x0720
        L3 Cache Handle: 0x0730
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable

 

 

 

 lsmod| grep "cpufreq"
acpi_cpufreq            6429  0
cpufreq_powersave       1126  0
cpufreq_performance     1130  0
processor              26582  1 acpi_cpufreq
cpufreq_stats           2865  0

 

 

 

Also made a trigger task in dsm to run at boot under root with this command   :  

modprobe acpi-cpufreq && systemctl start cpufreq-userspace-scaler.service

 

Edited by burtal
Link to comment
Share on other sites

4 hours ago, burtal said:

trying to get this working on a 3622xs  7.1.0-U2  on a microservergen8 with a xeon E3 1265v2

 

If i modify in scaler.sh

 

# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }')

 

From 4-1 to 7 -1 ....nothing happens .... if i leave the default 4-1 , only 4 cores  show low freq.

 

Am i doing something wrong here ?

 

 

image.thumb.png.35bfc9b0fca3c34a1adca2bdbc6d6577.png

 

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0400, DMI type 4, 42 bytes
Processor Information
        Socket Designation: Proc 1
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: A9 06 03 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 58, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version:  Intel(R) Xeon(R) CPU E3-1265L V2 @ 2.50GHz
        Voltage: 1.4 V
        External Clock: 100 MHz
        Max Speed: 4800 MHz
        Current Speed: 2500 MHz
        Status: Populated, Enabled
        Upgrade: Socket BGA1155
        L1 Cache Handle: 0x0710
        L2 Cache Handle: 0x0720
        L3 Cache Handle: 0x0730
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable

 

 

 

 lsmod| grep "cpufreq"
acpi_cpufreq            6429  0
cpufreq_powersave       1126  0
cpufreq_performance     1130  0
processor              26582  1 acpi_cpufreq
cpufreq_stats           2865  0

 

 

 

Also made a trigger task in dsm to run at boot under root with this command   :  

modprobe acpi-cpufreq && systemctl start cpufreq-userspace-scaler.service

 

Try to use this please :

cpucorecount=$(nproc)
 

I've tested this successfully on my config, i think it should work for hyperthreaded and standard threaded CPU's 
 

Edited by Trauma
Link to comment
Share on other sites

cpucorecount=$(nproc)  instead of  {print $4-1}  part ? .....

 

to be clear ..... here , after =?

# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }')

 

and  here ?

 

  # Set load steps to trigger frequencies scaling, this user overidable
  lowload=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 * 0.3 * 100 }')
  midload=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 * 0.6 * 100 }')

 

Edited by burtal
Link to comment
Share on other sites

7 часов назад, burtal сказал:

trying to get this working on a 3622xs  7.1.0-U2  on a microservergen8 with a xeon E3 1265v2

 

If i modify in scaler.sh

 

# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }')

 

From 4-1 to 7 -1 ....nothing happens .... if i leave the default 4-1 , only 4 cores  show low freq.

 

Am i doing something wrong here ?

 

 

image.thumb.png.35bfc9b0fca3c34a1adca2bdbc6d6577.png

 

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0400, DMI type 4, 42 bytes
Processor Information
        Socket Designation: Proc 1
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: A9 06 03 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 58, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version:  Intel(R) Xeon(R) CPU E3-1265L V2 @ 2.50GHz
        Voltage: 1.4 V
        External Clock: 100 MHz
        Max Speed: 4800 MHz
        Current Speed: 2500 MHz
        Status: Populated, Enabled
        Upgrade: Socket BGA1155
        L1 Cache Handle: 0x0710
        L2 Cache Handle: 0x0720
        L3 Cache Handle: 0x0730
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: Not Specified
        Core Count: 4
        Core Enabled: 4
        Thread Count: 8
        Characteristics:
                64-bit capable

 

 

 

 lsmod| grep "cpufreq"
acpi_cpufreq            6429  0
cpufreq_powersave       1126  0
cpufreq_performance     1130  0
processor              26582  1 acpi_cpufreq
cpufreq_stats           2865  0

 

 

 

Also made a trigger task in dsm to run at boot under root with this command   :  

modprobe acpi-cpufreq && systemctl start cpufreq-userspace-scaler.service

 

productivity monitoring software


Thanks for the detailed breakdown.

Link to comment
Share on other sites

5 hours ago, burtal said:

cpucorecount=$(nproc)  instead of  {print $4-1}  part ? .....

 

to be clear ..... here , after =?

# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }')

 

and  here ?

 

  # Set load steps to trigger frequencies scaling, this user overidable
  lowload=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 * 0.3 * 100 }')
  midload=$(grep cores /proc/cpuinfo | sort -u | awk '{ print $4 * 0.6 * 100 }')

 

The complete and correct cpucorecount command should be :

cpucorecount=$(nproc | awk '{ print $1 - 1 }')

 

If it return the right value, the same method can be used for lowload etc..

Link to comment
Share on other sites

if i replace that code in the scaler.sh  the service fails to start

 

 sudo systemctl status cpufreq-userspace-scaler.service
● cpufreq-userspace-scaler.service - ACPI cpufreq userspace scaler
   Loaded: loaded (/usr/lib/systemd/system/cpufreq-userspace-scaler.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2022-07-22 22:35:05 EEST; 19s ago
  Process: 6061 ExecStart=/usr/local/bin/scaler.sh (code=exited, status=1/FAILURE)
 Main PID: 6061 (code=exited, status=1/FAILURE)

Jul 22 22:35:05 Polaris systemd[1]: Started ACPI cpufreq userspace scaler.
Jul 22 22:35:05 Polaris systemd[1]: Starting ACPI cpufreq userspace scaler...
Jul 22 22:35:05 Polaris scaler.sh[6061]: /usr/local/bin/scaler.sh: line 67: echo: write error: Invalid argument
Jul 22 22:35:05 Polaris systemd[1]: cpufreq-userspace-scaler.service: main process exited, code=exited, status=1/FAILURE
Jul 22 22:35:05 Polaris systemd[1]: Unit cpufreq-userspace-scaler.service entered failed state.
Jul 22 22:35:05 Polaris systemd[1]: cpufreq-userspace-scaler.service failed.

 

image.thumb.png.b705a4392391c830eb0e76af0e639199.png

 

image.thumb.png.149b379f75304b30bed303208ddf50ec.png

Link to comment
Share on other sites

:(

image.thumb.png.861013215dcdfd70be3f587dc0895e82.png

 

while looking around the file system i found some mentioning for governors or power states   in /sys/module/   folder ....maybe this also helps

image.png.9aec1b6d33ba06180c8cf51af6c338b8.png

 

 

 

Why the hell synology removed the governors .....pff

Edited by burtal
Link to comment
Share on other sites

@burtal it seems like cpucorecount is not set properly for you. can you give me the output of those commands please :

nproc | awk '{ print $1 - 1 }'

and

grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }'

and

grep cores /proc/cpuinfo | sort -u | awk '{ print $7 - 1 }'

and
ls -l /sys/devices/system/cpu/

Edited by Trauma
Link to comment
Share on other sites

hello .... sure buddy, thanks for taking the time to debug this

 

 

root@Polaris:~# nproc | awk '{ print $1 - 1 }'
7
root@Polaris:~# grep cores /proc/cpuinfo | sort -u | awk '{ print $4 - 1 }'
3
root@Polaris:~# grep cores /proc/cpuinfo | sort -u | awk '{ print $7 - 1 }'
-1
root@Polaris:~# ls -l /sys/devices/system/cpu/
total 0
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu0
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu1
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu2
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu3
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu4
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu5
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu6
drwxr-xr-x  6 root root    0 Jul 23 12:49 cpu7
drwxr-xr-x 10 root root    0 Jul 23 12:50 cpufreq
drwxr-xr-x  2 root root    0 Jul 23 12:50 cpuidle
-r--r--r--  1 root root 4096 Jul 23 12:49 isolated
-r--r--r--  1 root root 4096 Jul 23 13:48 kernel_max
-r--r--r--  1 root root 4096 Jul 23 13:48 modalias
-r--r--r--  1 root root 4096 Jul 23 13:48 offline
-r--r--r--  1 root root 4096 Jul 23 12:49 online
-r--r--r--  1 root root 4096 Jul 23 13:48 possible
drwxr-xr-x  2 root root    0 Jul 23 12:50 power
-r--r--r--  1 root root 4096 Jul 23 13:48 present
-rw-r--r--  1 root root 4096 Jul 23 13:48 uevent
drwxr-xr-x  2 root root    0 Jul 23 12:50 vulnerabilities

 

 

image.png.a5f4e263640a5c071c8a0aeb7b293582.png

 

 

 

 

root@Polaris:~# grep cores /proc/cpuinfo | sort -u | awk '{ print $7 - 1 }'
-1   

 

This always return  - 1   if instead of print$4 -1  is any other number .... so maybe this being for ds918 which is 4cores ,will not work on higher cores CPU

 

image.png.5880bb611b92be221d061ecdda9731cc.png

Edited by burtal
Link to comment
Share on other sites

Ok, thanks.

 

So the new cpucorecount method works for you too, since it return 7 and you can see that you have /sys/devices/system/cpu/cpu0 to /sys/devices/system/cpu/cpu7 which is fine.

 

FYI `awk '{ print $1 - 1 }'` means `print the first field of the previous command minus 1` Since nproc return 8 for you, and since /sys/devices/system/cpu/cpu0 start at 0 we need to remove one core form the count to obtain the right value (7 for you). This to said that you first experiments were totally hazardous, and I can not explain why it worked for you.

 

If you want me to help further, please run the latest version of the script with `bash -x ./scaler.sh` and paste the output here (no screenshots please).

 

Cheers.

 

Link to comment
Share on other sites

+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 410 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=410
++ cut -c 1-3
+ maxtemp=900
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=019
+ minfreq=1600000
+ midfreq=2100000
+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 410 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=420
++ cut -c 1-3
+ maxtemp=900
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=019
+ minfreq=1600000
+ midfreq=2100000
+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 420 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 019 -le 240 ']'
+ echo 1600000
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=420
++ cut -c 1-3
+ maxtemp=900
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=017
+ minfreq=1600000
+ midfreq=2100000
+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 420 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=410
++ cut -c 1-3
+ maxtemp=900
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=017
+ minfreq=1600000
+ midfreq=2100000
+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 410 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=410
++ cut -c 1-3
+ maxtemp=900
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=017
+ minfreq=1600000
+ midfreq=2100000
+ maxfreq=2501000
+ coolfreq=2300000
++ nproc
++ awk '{ print $1 * 0.3 * 100 }'
+ lowload=240
++ nproc
++ awk '{ print $1 * 0.6 * 100 }'
+ midload=480
+ '[' 410 -lt 900 ']'
++ seq 0 7
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ for i in $(seq 0 "${cpucorecount}")
+ '[' 017 -le 240 ']'
+ echo 1600000
+ sleep 0.5

 

Link to comment
Share on other sites

hmm ... i did not reinstall or do anything after the initial install that stated it failed

 

yes ... it appears to be clocked down but the scaler service status say is not started

 

 

root@Polaris:~# grep MHz /proc/cpuinfo
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
cpu MHz         : 1600.000
root@Polaris:~# systemctl status cpufreq-userspace-scaler.service
● cpufreq-userspace-scaler.service - ACPI cpufreq userspace scaler
   Loaded: loaded (/usr/lib/systemd/system/cpufreq-userspace-scaler.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2022-07-23 12:50:28 EEST; 7h ago
  Process: 13924 ExecStart=/usr/local/bin/scaler.sh (code=exited, status=1/FAILURE)

 Main PID: 13924 (code=exited, status=1/FAILURE)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

 


root@Polaris:~# systemctl start cpufreq-userspace-scaler.service
root@Polaris:~# systemctl status cpufreq-userspace-scaler.service

 


● cpufreq-userspace-scaler.service - ACPI cpufreq userspace scaler
   Loaded: loaded (/usr/lib/systemd/system/cpufreq-userspace-scaler.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2022-07-23 20:06:41 EEST; 6s ago
 Main PID: 14939 (scaler.sh)
   Memory: 1.0M
   CGroup: /system.slice/cpufreq-userspace-scaler.service
           ├─14939 /bin/bash /usr/local/bin/scaler.sh

           └─15144 sleep 0.5

Jul 23 20:06:41 Polaris systemd[1]: Started ACPI cpufreq userspace scaler.
Jul 23 20:06:41 Polaris systemd[1]: Starting ACPI cpufreq userspace scaler...

 

Link to comment
Share on other sites

update ...looks like now is working .... it ramps up and down as expected.

 

Not as smooth as previous method with governors , where individual cores have different speeds .... but is all good for my purpose .... thank you for your support and time 

  • Thanks 1
Link to comment
Share on other sites

i get around 58-60w on my microserver gen8 with 4 disks: 2 HGST 4TB and 2 WD blacks 1TB .....is not as efficient as using governors as in 6.2.3

 

In 6.2.3 when i was hammering the cpu difference between performance profile and powesaver or conservative was about 10-15w....but at least im trying to cut power and especially heat so that is i use the method

 

with this method unfortunately has less modulation in cpu freq PER core .... from what i`ve seen  if the load is high on one single core, all will boost all to the same freq ... so is like on/off not granular increments 

Edited by burtal
Link to comment
Share on other sites

48 minutes ago, Trauma said:
  1. Download the archive : https://github.com/Trauma/cpufreq-userspace-scaler/archive/refs/heads/master.zip
  2. Extract the archive
  3. copy the files to your nas
  4. ssh to your nas
  5. cd path/to/cpufreq-userspace-scaler-master
  6. sudo ./install.sh

 

 

I was able to install thanks to your instructions.
But the script doesn't seem to work on my device: the frequency of my cpu (j5040) remains fixed at 1800.

what can i try to do to try to solve?

 

this is my lsmod| grep "cpufreq" output:


acpi_cpufreq            6557  0
cpufreq_powersave       1126  0
cpufreq_performance     1130  0
processor              27030  5 acpi_cpufreq
cpufreq_stats           2929  0
 

 

this is my `bash -x ./scaler.sh` output:

 sudo bash -x ./scaler.sh
+ set -euo pipefail
+ '[' 0 -ne 0 ']'
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 - 1 }'
+ cpucorecount=3
+ modprobe acpi-cpufreq
++ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ governor=userspace
+ '[' userspace '!=' userspace ']'
+ IFS=' '
+ read -r -a freqlist
++ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
+ scalingminfreq=800000
+ scalingmaxfreq=2001000
+ '[' userspace = userspace ']'
++ seq 0 3
+ for i in $(seq 0 "${cpucorecount}")
+ echo 800000
+ echo 2001000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 800000
+ echo 2001000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 800000
+ echo 2001000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 800000
+ echo 2001000
+ true
+ main
++ cut -c 1-3
+ currtemp=420
++ cut -c 1-3
+ maxtemp=105
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=000
+ minfreq=800000
+ midfreq=1400000
+ maxfreq=2001000
+ coolfreq=1800000
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.3 * 100 }'
+ lowload=120
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.6 * 100 }'
+ midload=240
+ '[' 420 -lt 105 ']'
++ seq 0 3
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ sleep 30
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=430
++ cut -c 1-3
+ maxtemp=105
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=000
+ minfreq=800000
+ midfreq=1400000
+ maxfreq=2001000
+ coolfreq=1800000
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.3 * 100 }'
+ lowload=120
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.6 * 100 }'
+ midload=240
+ '[' 430 -lt 105 ']'
++ seq 0 3
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ sleep 30
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=430
++ cut -c 1-3
+ maxtemp=105
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=013
+ minfreq=800000
+ midfreq=1400000
+ maxfreq=2001000
+ coolfreq=1800000
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.3 * 100 }'
+ lowload=120
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.6 * 100 }'
+ midload=240
+ '[' 430 -lt 105 ']'
++ seq 0 3
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ sleep 30
+ sleep 0.5
+ true
+ main
++ cut -c 1-3
+ currtemp=430
++ cut -c 1-3
+ maxtemp=105
++ awk -F . '{print $1 substr($2,1,2)}'
+ loadavg=008
+ minfreq=800000
+ midfreq=1400000
+ maxfreq=2001000
+ coolfreq=1800000
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.3 * 100 }'
+ lowload=120
++ grep cores /proc/cpuinfo
++ sort -u
++ awk '{ print $4 * 0.6 * 100 }'
+ midload=240
+ '[' 430 -lt 105 ']'
++ seq 0 3
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ for i in $(seq 0 "${cpucorecount}")
+ echo 1800000
+ sleep 30

 

Thanks 

Edited by jakino
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...