You are not logged in.

#1 2013-01-16 14:21:37

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

[SOLVED] cpufreq incompatibilities

I encounter some performance problems. It takes twice the time to compile same ebuild depending on booting from SystemRescueCd or from Funtoo.

Emerging ebuild when booting on SystemRescueCd is faster. When I look at /sys/devices/cpu/cpu0/cpufreq I can see that bioo_limit is 2260000 in Funtoo and 2400000 in Sysresc. Same for scaling_max_freq. When I look through BIOS, frequency is 2.40.

How can I fix it ?

Last edited by aramis_qc (2013-01-17 13:43:34)

Offline

#2 2013-01-16 15:33:34

overkill
Member
Registered: 2011-09-13
Posts: 243

Re: [SOLVED] cpufreq incompatibilities

Much depends on kernel configuration.  I believe the kernel for sysrescue uses "Pentium_Pro" as the CPU type.  I have I AMD Phenom II X6 1090T which at stock is supposed to run at 3.2GHz.  When using sysrescueCD, it defaults to 3.611GHz.  Haven't looked into the cpufreq settings on sysrescue but I'm guessing it's probably no activated or set to "performance".

If you have all the correct kernel options for cpufreq scaling, you can check and change the performance governor in /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor.

I use "ondemand" by default.  It's the power saving governor.  I also made a simple script that changes all processors from "ondemand" to "performance".  It's basically just a one liner:

#!/bin/sh
for i in `find /sys/ -name "scaling_governor"`; do `echo performance > $i`; done

I have a second script to change it back - same as the first except performance is changed to ondemand:

#!/bin/sh
for i in `find /sys/ -name "scaling_governor"`; do `echo ondemand > $i`; done

To quickly check what frequency the of the cpu(s):

# grep MHz /proc/cpuinfo
cpu MHz		: 800.000
cpu MHz		: 800.000
cpu MHz		: 800.000
cpu MHz		: 800.000
cpu MHz		: 800.000
cpu MHz		: 800.000

Thats my Phenom 6 core with "ondemand".  Here it is again after running my little script:

# grep MHz /proc/cpuinfo 
cpu MHz		: 3600.000
cpu MHz		: 3600.000
cpu MHz		: 3600.000
cpu MHz		: 3600.000
cpu MHz		: 3600.000
cpu MHz		: 3600.000

(it's overclocked from 3.2 to 3.6GHz ;P )
Be aware that ondemand should be sufficient, but the compiling is definitely faster with cpufreq set to performance.  I usually change to performance when compiling then switch back to ondemand for normal usage.

Last edited by overkill (2013-01-17 00:51:30)

Offline

#3 2013-01-16 16:05:06

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

I'm sorry overkill... performance is better with on demand. That's what Sysresc uses. I ran many tests. Performance is better with ON DEMAND.

Offline

#4 2013-01-16 16:06:49

jasn
Member
From: Annapolis, MD
Registered: 2011-01-09
Posts: 181

Re: [SOLVED] cpufreq incompatibilities

Thanks for the scripts. (BTW, one typo in the second script. Should be ondemand instead of onemand.)

Jason

Offline

#5 2013-01-16 18:05:51

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

Shame on me overkill !

I used your commands.

Emerging firefox-18.0 wiht ON DEMAND :

Tue Jan 15 20:20:02 2013 >>> www-client/firefox-18.0
       merge time: 46 minutes and 45 seconds.

Emerging firefox-18.0 with PERFORMANCE

     Wed Jan 16 12:57:43 2013 >>> www-client/firefox-18.0
       merge time: 45 minutes and 22 seconds.

MHz with PERFORMANCE


cpu MHz        : 2400.000
cpu MHz        : 2400.000
cpu MHz        : 2400.000
cpu MHz        : 2400.000

MHz with ON DEMAND

cpu MHz        : 1199.000
cpu MHz        : 1199.000
cpu MHz        : 1199.000
cpu MHz        : 1199.000

When I emerge with ON DEMAND in Funtoo :

Fri Jan 11 15:11:41 2013 >>> www-client/firefox-18.0
       merge time: 1 hour, 23 minutes and 28 seconds.

Same emerge with PERFORMANCE takes up to 2 hours and 30 minutes.

I really have no idea !!!!!!

Offline

#6 2013-01-16 18:13:08

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

Running overkill's commands in Funtoo :

delta ~ # for i in `find /sys/ -name "scaling_governor"`; do `echo performance > $i`; done
delta ~ # grep MHz /proc/cpuinfo
cpu MHz		: 2266.000
cpu MHz		: 2266.000
cpu MHz		: 2266.000
cpu MHz		: 2266.000
delta ~ # for i in `find /sys/ -name "scaling_governor"`; do `echo ondemand > $i`; done
delta ~ # grep MHz /proc/cpuinfo
cpu MHz		: 1199.000
cpu MHz		: 1199.000
cpu MHz		: 2266.000
cpu MHz		: 1199.000

Offline

#7 2013-01-17 00:40:06

overkill
Member
Registered: 2011-09-13
Posts: 243

Re: [SOLVED] cpufreq incompatibilities

jasn wrote:

Thanks for the scripts. (BTW, one typo in the second script. Should be ondemand instead of onemand.)

Jason

Yeah, I saw that.  That's what I get for not cutting and pasting.  lol.

Offline

#8 2013-01-17 00:50:16

overkill
Member
Registered: 2011-09-13
Posts: 243

Re: [SOLVED] cpufreq incompatibilities

@amaris_qc,

The 1199 with "ondemand" is the base frequency.  It will scale up to 2266 for you when it gets busy (compiling).  The main speed up I see is when the processors/cpus are not under load during configure stages or less demanding stages in emerge, the cpus throttle down causing the delay as oppossed to the "performance" setting having the CPU's maxed out and ready.

The only thing I suggest is to double check your kernel config and your cflags/cxxflags.  Are your using -O3 or any other "ricer" settings?

I just use "-march=native -pipe -O2"  for both cflags and cxxflags.

Offline

#9 2013-01-17 01:49:18

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

@overkill

May make.conf is very basic :

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="-march=core2 -O2 -pipe"
MAKEOPTS="-j5"
USE="cairo consolekit dbus -gnome gtk gtk3 jpeg libnotify lock session spell startup-notification svg thunar udev usb X"
GENTOO_MIRRORS="ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ /http://distfiles.gentoo.org"
LINGUAS="fr"
VIDEO_CARDS="intel"
PORTAGE_ELOG_CLASSES="log warn error info"
PORTAGE_ELOG_SYSTEM="echo:log,warn save:log,warn,error,info syslog:error"
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=5.0 --with-bdeps y"

Palica suggested me to add processor.ignore_ppc=1 on the kernel line. I did. Here's my boot.conf :

boot {
	generate grub
	default "Funtoo Vanilla Xfce4" 
	timeout 3 
}

"Funtoo Vanilla Xfce4" {
	kernel vmlinuz[-v]
	params += processor.ignore_ppc=1
} 

"Funtoo Testing" {
	scan /mnt/funtoo/boot
	kernel vmlinuz[-v]
	params root=/dev/sda7
	params += processor.ignore_ppc=1
}

My laptop is a Dell. Dell locks CPU speed to 2.26. With this statement on the kernel line I can have full speed in PERFORMANCE. It's a matter of fact that 1199 is the miminum and it's the value when frequency is set to ON DEMAND.

I really appreciate your commands. I use them. I will run some other tests with a kernel configured with a seed + a couple of additional features : XFS, BTRFS, Intel Wireless WiFi AGN and SMSCLAN75XX for my USB network adapter.

Offline

#10 2013-01-17 03:06:09

overkill
Member
Registered: 2011-09-13
Posts: 243

Re: [SOLVED] cpufreq incompatibilities

aramis_qc wrote:

@overkill
I really appreciate your commands. I use them. I will run some other tests with a kernel configured with a seed + a couple of additional features : XFS, BTRFS, Intel Wireless WiFi AGN and SMSCLAN75XX for my USB network adapter.

You're welcome.  Here's another one - to watch the frequency of the cpus change with activity:

# watch -n .2 grep MHz /proc/cpuinfo

"watch -n .2" refreshes the "grep MHz /proc/cpuinfo" command every .2 seconds.  One can make that any interval of seconds one desires.

I just had a thought re your laptop and compiling differences.  Is Hyperthreading enabled with Sysrescue and not Funtoo or visa versa?

If you have a core2duo, that's only 2 physical cores, right?  If 4 cores show up in /proc/cpuinfo, then hyperthreading is enabled.

Offline

#11 2013-01-17 04:01:27

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

Hyperthreading is set with Funtoo... Indeed a dual core i5 :

grep -c "processor" /proc/cpuinfo
4

I have to check with SystemRescueCd ALTKER64...but it should be.

The best score I got when emerging firefox-18.0 is between 68 mins and 72 mins.

I'm gonna contact someone living nearby who knows how to patch kernel. Maybe he'll find out why SysResc kernel (Fedora patched) performs better... 46 mins.

Thank's again.

Last edited by aramis_qc (2013-01-17 04:02:49)

Offline

#12 2013-01-17 13:43:12

aramis_qc
Member
From: Québec - Canada
Registered: 2010-10-07
Posts: 312

Re: [SOLVED] cpufreq incompatibilities

Offline

Board footer

Powered by FluxBB