All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: cpufreq and p4 prescott
@ 2004-05-12 17:14 Dominik Brodowski
  2004-05-13  9:19 ` clemens kurtenbach
  2004-05-13 12:06 ` Dominik Brodowski
  0 siblings, 2 replies; 14+ messages in thread
From: Dominik Brodowski @ 2004-05-12 17:14 UTC (permalink / raw)
  To: linux-kernel, moqua

> i have problems scaling down my p4 prescott 2.8 GHz.
You can't scale a prescott, you can only throttle it.

> [ck@holodeck:cpufreq] cat /proc/cpuinfo | grep Mhz
> cpu MHz         : 2807.131
> cpu MHz         : 2807.131
The cpu MHz entry in /proc/cpuinfo is the same for all CPUs, and no reliable
source to detect the current cpu frequency anyway. Use
/sys/devices/system/cpu/cpu0/scaling_cur_freq or even cpuinfo_cur_freq for
that.[*] So p4-clockmod-throttling does work on your p4 prescott.

	Dominik

[*] Available in 2.6.7, hopefully, if Linus merges the latest cpufreq-bk
tree from Dave. It'll be in the next -mm release, though.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: cpufreq and p4 prescott
@ 2004-05-13 17:39 ` Dominik Brodowski
  0 siblings, 0 replies; 14+ messages in thread
From: Dominik Brodowski @ 2004-05-13 17:39 UTC (permalink / raw)
  To: cpufreq, linux-kernel, rutger, moqua

[-- Attachment #1: Type: text/plain, Size: 2409 bytes --]

> > So i'm not sure if throttling does work until now?
> 
> No, I think something is broken. There is something wrong, but I do
> not know what exactly. Maybe other people can help.
>
> Problem #1 is the speed measurement, as you described. As far as I
> understand, p4-clockmod delivers the same external clock to the P4,
> but work is not done during every clock tick. E.g. when running at
> 12.5% of the maximum frequency, only one tick in eight something is
> done.

Almost. The Time Stamp Counter (inside the CPU) works with a constant
frequency, but only at e.g. each eigth tick the other parts of the CPU do
some work.

> Ok, so if it is true that only the work is done part of the ticks,
> then all instructions should take more ticks! Therefore, I try to
> measure the number of ticks which the 'rdtsc' instruction itself
> takes. I take the minimum of 10 runs, to run
> instruction-cache-hot. See cpuclockmod.c .
> 
> This gives '140' cycles in the pre-modulated phase (including some
> overhead) when running on an idle system, and 154 or 161 running on a
> loaded system (1 thread busy looping). If clock modulation meant
> 'skipping ticks', I would expect this number to multiply.

Not necessarily. It's not really every eigth tick where work is done, but
more like 800 ticks where work is done, then 5600 ticks pause, and so on --
the frequency is somewhere in the docs, I forgot the exact value... So I'm
not 100% convinced the measurements you've done do show something broken.

> This doesn't change a thing, which is to be expected since cpufreq
> talks to real CPUs.

It should, something _is_ broken in this regard [and I'm working on it, just
had sent a RFC to the cpufreq mailing list...]. Maybe this causes some
strangeness, especially if you run a userspace cpufreq tool -- but maybe the
p4-clockmod hardware is even more strange than I thought it to be, and is
per _virtual_ CPU.

Can you please apply the latest cpufreq snapshot from
http://www.codemonkey.org.uk/projects/bitkeeper/cpufreq/
, then the attached patch, and switch the CPU frequencies of both (virtual)
CPUs around a bit, and after each switch, 
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq

and check whether the values are the same you wrote into the specific CPU's
scaling_setspeed [if using the userspace governor] file?

Many thanks,
	Dominik

[-- Attachment #2: test_p4 --]
[-- Type: text/plain, Size: 1018 bytes --]

diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c linux/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
--- linux-original/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2004-05-13 16:52:02.000000000 +0200
+++ linux/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2004-05-13 19:36:47.629852152 +0200
@@ -68,11 +68,7 @@
 	cpus_allowed = current->cpus_allowed;
 
 	/* only run on CPU to be set, or on its sibling */
-#ifdef CONFIG_SMP
-	affected_cpu_map = cpu_sibling_map[cpu];
-#else
 	affected_cpu_map = cpumask_of_cpu(cpu);
-#endif
 	set_cpus_allowed(current, affected_cpu_map);
         BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
 
@@ -273,11 +269,7 @@
 
 	/* only run on CPU to be set, or on its sibling */
 	cpus_allowed = current->cpus_allowed;
-#ifdef CONFIG_SMP
-        affected_cpu_map = cpu_sibling_map[cpu];
-#else
         affected_cpu_map = cpumask_of_cpu(cpu);
-#endif
 	set_cpus_allowed(current, affected_cpu_map);
         BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
 

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 14+ messages in thread
* cpufreq and p4 prescott
@ 2004-05-12 15:28 clemens kurtenbach
  0 siblings, 0 replies; 14+ messages in thread
From: clemens kurtenbach @ 2004-05-12 15:28 UTC (permalink / raw)
  To: linux-kernel

Hi,

i have problems scaling down my p4 prescott 2.8 GHz.
In the /sys -tree all seems to be ok:

[ck@holodeck:cpufreq] pwd
/sys/devices/system/cpu/cpu0/cpufreq

[ck@holodeck:cpufreq] ls -1
cpuinfo_max_freq
cpuinfo_min_freq
scaling_available_frequencies
scaling_available_governors
scaling_driver
scaling_governor
scaling_max_freq
scaling_min_freq
scaling_setspeed

[ck@holodeck:cpufreq] cat *
2800000
350000
350000 700000 1050000 1400000 1750000 2100000 2450000 2800000
powersave userspace performance
p4-clockmod
userspace
2800000
350000
350000

[ck@holodeck:cpufreq] cat /proc/cpuinfo | grep Mhz
cpu MHz         : 2807.131
cpu MHz         : 2807.131

As you can see tools like cpudyn or powernowd successfully
change the entry in scaling_setspeed (also for cpu1),
but the real cpu clock stays at 2.8GHz ?

The cpudyn doc sais there's support for 'Intel Pentium 4, Intel Xeon'
CPU's, but is there support for p4 prescott ?

Has annyone here successfully scaled down a prescott ?

regards,
clee
-- 
moqua [at] gmx.net
moqua [at] kurtenba.ch

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-05-16 13:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-12 17:14 cpufreq and p4 prescott Dominik Brodowski
2004-05-13  9:19 ` clemens kurtenbach
2004-05-13 15:30   ` rutger
2004-05-13 12:06 ` Dominik Brodowski
  -- strict thread matches above, loose matches on Subject: below --
2004-05-13 17:39 Dominik Brodowski
2004-05-13 17:39 ` Dominik Brodowski
2004-05-14 21:47 ` rutger
2004-05-15  6:44   ` Dominik Brodowski
2004-05-15  6:44     ` Dominik Brodowski
2004-05-15 10:52     ` rutger
2004-05-15 19:41       ` Dominik Brodowski
2004-05-15 19:41         ` Dominik Brodowski
2004-05-16 13:20         ` Rutger Nijlunsing
2004-05-12 15:28 clemens kurtenbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.