2009-01-27 20:23:26

by Xiaoning Ding

[permalink] [raw]
Subject: a question about p4_clockmod module on Xeon quad core processors

Hi list,

I have tried the p4-clockmod module in Linux kernel 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems current p4-clockmod driver still cannot support Intel Quad core processors, right?

I know I can also use acpi-cpufreq. It can only scale down the frequence from 2.67GHz to 2GHz. But I need some lower frequencies for some experiments.

Thanks!

Xiaoning




2009-01-27 21:23:43

by Arjan van de Ven

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

On Tue, 27 Jan 2009 12:17:25 -0800 (PST)
Xiaoning Ding <[email protected]> wrote:

> Hi list,
>
> I have tried the p4-clockmod module in Linux kernel 2.6.29 on Xeon
> 5355 quad-core CPUs with no luck. It seems current p4-clockmod driver
> still cannot support Intel Quad core processors, right?

you know that using clockmod will actually cost you energy rather than
saving it right?


--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2009-01-28 21:02:23

by Dave Jones

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

On Tue, Jan 27, 2009 at 12:17:25PM -0800, Xiaoning Ding wrote:
> Hi list,
>
> I have tried the p4-clockmod module in Linux kernel 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems current p4-clockmod driver still cannot support Intel Quad core processors, right?
>
> I know I can also use acpi-cpufreq. It can only scale down the frequence from 2.67GHz to 2GHz. But I need some lower frequencies for some experiments.

p4-clockmod doesn't change the processor frequency.
Because of common misconceptions like this, the user interface has been removed.

In 2.6.29, the clock modulation code is called directly from ACPI
whenever thermal events indicate that throttling is necessary.

Dave

--
http://www.codemonkey.org.uk

2009-01-28 21:06:29

by Wes Felter

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

Xiaoning Ding wrote:
> Hi list,
>
> I have tried the p4-clockmod module in Linux kernel 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems current p4-clockmod driver still cannot support Intel Quad core processors, right?
>
> I know I can also use acpi-cpufreq. It can only scale down the frequence from 2.67GHz to 2GHz. But I need some lower frequencies for some experiments.

Clock modulation is quite simple; in the past I've done it from
userspace with /dev/cpu/*/msr or written my own module to do it. I don't
know if I've ever tried it on quad-cores, but it worked on dual-core
Woodcrest. (Note: I was not trying to save energy.)

Wes Felter - [email protected]

2009-01-29 02:06:50

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

Thanks for the correction.
My experiments need to reduce CPU speed. However, I can only reduce the speed by about 30% (from 2.67GHz to 2GHz) with ACPI. That is not enough for the experiments.

p4-clockmod has not been removed from 2.6.29. It is under the same directory as acpi-cpufreq (arch/x86/kernel/cpu/cpufreq). So I thought it was an alternative approach. But I could not get it loaded.

Xiaoning


--- On Wed, 1/28/09, Dave Jones <[email protected]> wrote:

> From: Dave Jones <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: "Xiaoning Ding" <[email protected]>
> Cc: [email protected]
> Date: Wednesday, January 28, 2009, 9:02 PM
> On Tue, Jan 27, 2009 at 12:17:25PM -0800, Xiaoning Ding
> wrote:
> > Hi list,
> >
> > I have tried the p4-clockmod module in Linux kernel
> 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems
> current p4-clockmod driver still cannot support Intel Quad
> core processors, right?
> >
> > I know I can also use acpi-cpufreq. It can only scale
> down the frequence from 2.67GHz to 2GHz. But I need some
> lower frequencies for some experiments.
>
> p4-clockmod doesn't change the processor frequency.
> Because of common misconceptions like this, the user
> interface has been removed.
>
> In 2.6.29, the clock modulation code is called directly
> from ACPI
> whenever thermal events indicate that throttling is
> necessary.
>
> Dave
>
> --
> http://www.codemonkey.org.uk



2009-01-29 02:11:54

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

I installed msr-tools, but could not find detailed information on how to change cpu speed with the tools. Can you point me to detailed documentations? Or, can you share your code?

Thanks!

Xiaoning

--- On Wed, 1/28/09, Wes Felter <[email protected]> wrote:

> From: Wes Felter <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: [email protected]
> Cc: [email protected]
> Date: Wednesday, January 28, 2009, 9:05 PM
> Xiaoning Ding wrote:
> > Hi list,
> >
> > I have tried the p4-clockmod module in Linux kernel
> 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems
> current p4-clockmod driver still cannot support Intel Quad
> core processors, right?
> > I know I can also use acpi-cpufreq. It can only scale
> down the frequence from 2.67GHz to 2GHz. But I need some
> lower frequencies for some experiments.
>
> Clock modulation is quite simple; in the past I've done
> it from userspace with /dev/cpu/*/msr or written my own
> module to do it. I don't know if I've ever tried it
> on quad-cores, but it worked on dual-core Woodcrest. (Note:
> I was not trying to save energy.)
>
> Wes Felter - [email protected]



2009-01-29 02:45:52

by Dave Jones

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

[please don't top-post]

On Wed, Jan 28, 2009 at 06:06:37PM -0800, Xiaoning Ding wrote:

> > > I have tried the p4-clockmod module in Linux kernel
> > 2.6.29 on Xeon 5355 quad-core CPUs with no luck. It seems
> > current p4-clockmod driver still cannot support Intel Quad
> > core processors, right?
> > >
> > > I know I can also use acpi-cpufreq. It can only scale
> > down the frequence from 2.67GHz to 2GHz. But I need some
> > lower frequencies for some experiments.
> >
> > p4-clockmod doesn't change the processor frequency.
> > Because of common misconceptions like this, the user
> > interface has been removed.
> >
> > In 2.6.29, the clock modulation code is called directly
> > from ACPI
> > whenever thermal events indicate that throttling is
> > necessary.
> >
> Thanks for the correction.
> My experiments need to reduce CPU speed. However, I can only reduce the speed by about 30% (from 2.67GHz to 2GHz) with ACPI. That is not enough for the experiments.

The ACPI P-states are nearly always correct, so you won't be
able to go below 2GHz on this system.

> p4-clockmod has not been removed from 2.6.29. It is under the same directory as acpi-cpufreq (arch/x86/kernel/cpu/cpufreq). So I thought it was an alternative approach. But I could not get it loaded.

The driver is present, the _user interface_ has been removed.

Dave

--
http://www.codemonkey.org.uk

2009-01-29 12:27:42

by Michael Tokarev

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

Dave Jones wrote:
[]
> p4-clockmod doesn't change the processor frequency.

Hmm.. But what it really does, then?
I used it one one machine which had a flaky CPU cooler,
to reduce power consumption during hot summer days.
It worked, and reportedly the frequency varied from
200MHz to the max of 2.4GHz (it's a P4 Xeon). Now
I wonder why it helped to reduce the temperature and
why the system reported different frequencies...

Thanks!

> Because of common misconceptions like this, the user interface has been removed.


/mjt

2009-01-29 16:12:20

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

I am not trying to save energy. I want to do some experiments that requires lower CPU speed. But the experiments are not energy related.

Xiaoning

--- On Tue, 1/27/09, Arjan van de Ven <[email protected]> wrote:

> From: Arjan van de Ven <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: [email protected]
> Cc: [email protected]
> Date: Tuesday, January 27, 2009, 9:23 PM
> On Tue, 27 Jan 2009 12:17:25 -0800 (PST)
> Xiaoning Ding <[email protected]> wrote:
>
> > Hi list,
> >
> > I have tried the p4-clockmod module in Linux kernel
> 2.6.29 on Xeon
> > 5355 quad-core CPUs with no luck. It seems current
> p4-clockmod driver
> > still cannot support Intel Quad core processors,
> right?
>
> you know that using clockmod will actually cost you energy
> rather than
> saving it right?
>
>
> --
> Arjan van de Ven Intel Open Source Technology Centre
> For development, discussion and tips for power savings,
> visit http://www.lesswatts.org



2009-01-29 16:32:56

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors




--- On Thu, 1/29/09, Dave Jones <[email protected]> wrote:

> From: Dave Jones <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: "Xiaoning Ding" <[email protected]>
> Cc: [email protected]
> Date: Thursday, January 29, 2009, 2:45 AM
> [please don't top-post]
>
> On Wed, Jan 28, 2009 at 06:06:37PM -0800, Xiaoning Ding
> wrote:
>
> > > > I have tried the p4-clockmod module in
> Linux kernel
> > > 2.6.29 on Xeon 5355 quad-core CPUs with no luck.
> It seems
> > > current p4-clockmod driver still cannot support
> Intel Quad
> > > core processors, right?
> > > >
> > > > I know I can also use acpi-cpufreq. It can
> only scale
> > > down the frequence from 2.67GHz to 2GHz. But I
> need some
> > > lower frequencies for some experiments.
> > >
> > > p4-clockmod doesn't change the processor
> frequency.
> > > Because of common misconceptions like this, the
> user
> > > interface has been removed.
> > >
> > > In 2.6.29, the clock modulation code is called
> directly
> > > from ACPI
> > > whenever thermal events indicate that throttling
> is
> > > necessary.
> > >
> > Thanks for the correction.
> > My experiments need to reduce CPU speed. However, I
> can only reduce the speed by about 30% (from 2.67GHz to
> 2GHz) with ACPI. That is not enough for the experiments.
>
> The ACPI P-states are nearly always correct, so you
> won't be
> able to go below 2GHz on this system.

That's true for changing P-States with ACPI. But I can still get slower speed with clock modulation, right?

> > p4-clockmod has not been removed from 2.6.29. It is
> under the same directory as acpi-cpufreq
> (arch/x86/kernel/cpu/cpufreq). So I thought it was an
> alternative approach. But I could not get it loaded.
>
> The driver is present, the _user interface_ has been
> removed.

The module cannot loaded on Xeon 5355. If I can load it, I hope I can find a method to use it.

> Dave
>
> --
> http://www.codemonkey.org.uk
> --
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



2009-01-29 17:09:19

by Dave Jones

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

On Thu, Jan 29, 2009 at 08:32:41AM -0800, Xiaoning Ding wrote:

> > > Thanks for the correction.
> > > My experiments need to reduce CPU speed. However, I
> > can only reduce the speed by about 30% (from 2.67GHz to
> > 2GHz) with ACPI. That is not enough for the experiments.
> >
> > The ACPI P-states are nearly always correct, so you
> > won't be
> > able to go below 2GHz on this system.
>
> That's true for changing P-States with ACPI. But I can still get slower speed with clock modulation, right?

Clock modulation will lower the performance, but the clock speed
will remain constant.

Dave

--
http://www.codemonkey.org.uk

2009-01-29 17:24:31

by Dave Jones

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

On Thu, Jan 29, 2009 at 03:27:24PM +0300, Michael Tokarev wrote:

> > p4-clockmod doesn't change the processor frequency.
>
> Hmm.. But what it really does, then?

it modulates the clock so the CPU isn't always availble for doing work.

> I used it one one machine which had a flaky CPU cooler,
> to reduce power consumption during hot summer days.

it reduces the amount of heat generated, by making jobs
take longer to finish. This comes at a cost of the CPU not
being able to enter lower C states for longer periods of time,
so you may end up actually using *more* power.

> It worked, and reportedly the frequency varied from
> 200MHz to the max of 2.4GHz (it's a P4 Xeon).

The CPU was always at 2.4GHz, even if it said '200MHz'.
It was just only doing work once in every 12 clocks.

Dave

--
http://www.codemonkey.org.uk

2009-01-29 19:40:39

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

--- On Thu, 1/29/09, Dave Jones <[email protected]> wrote:

> From: Dave Jones <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: "Michael Tokarev" <[email protected]>
> Cc: "Xiaoning Ding" <[email protected]>, [email protected]
> Date: Thursday, January 29, 2009, 5:24 PM
> On Thu, Jan 29, 2009 at 03:27:24PM +0300, Michael Tokarev
> wrote:
>
> > > p4-clockmod doesn't change the processor
> frequency.
> >
> > Hmm.. But what it really does, then?
>
> it modulates the clock so the CPU isn't always availble
> for doing work.
>
> > I used it one one machine which had a flaky CPU
> cooler,
> > to reduce power consumption during hot summer days.
>
> it reduces the amount of heat generated, by making jobs
> take longer to finish. This comes at a cost of the CPU not
> being able to enter lower C states for longer periods of
> time,
> so you may end up actually using *more* power.
>
> > It worked, and reportedly the frequency varied from
> > 200MHz to the max of 2.4GHz (it's a P4 Xeon).
>
> The CPU was always at 2.4GHz, even if it said
> '200MHz'.
> It was just only doing work once in every 12 clocks.
>
> Dave
>
> --
> http://www.codemonkey.org.uk
> --
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

Thanks for the explanation. So the conclusion is that ACPI-cpufreq can reduce power consumption by lowering cpu frequencies, and p4-clockmod can hardly save power because CPU frequences are not changed.

My experiments do not consider power consumption. It only requires to slow down the speed of some cores by either reducing frequencies or clock modulation. In such case, p4-clockmod is still a good choice for me. Can anyone give me some hints on whether p4-clockmod works on Xeon quad-core processors, and how to get it work?

Thanks!

Xiaoning



2009-01-29 19:55:13

by Dave Jones

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

On Thu, Jan 29, 2009 at 11:40:25AM -0800, Xiaoning Ding wrote:

> Thanks for the explanation. So the conclusion is that ACPI-cpufreq
> can reduce power consumption by lowering cpu frequencies, and
> p4-clockmod can hardly save power because CPU frequences are not
> changed.

yes. and also that it inhibits entering deeper C states for longer periods.

> My experiments do not consider power consumption. It only requires to
> slow down the speed of some cores by either reducing frequencies or
> clock modulation. In such case, p4-clockmod is still a good choice for
> me. Can anyone give me some hints on whether p4-clockmod works on Xeon
> quad-core processors, and how to get it work?

I'm not sure if the registers are still there on quad cores, but I
would be surprised if they weren't. Hitting them directly with
msr tools is probably the best way, or writing a small program
that manipulates /dev/cpu/*/msr directly.

Dave

--
http://www.codemonkey.org.uk

2009-01-29 20:47:20

by Wes Felter

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

This will give you an effective speed of 250 MHz:

for cpu in 0 1 2 3; do
cpufreq-set -c $cpu -g userspace
cpufreq-set -c $cpu -u 2.0GHz
wrmsr -p $cpu 0x19A 0x12
done

0x19A is the IA32_CLOCK_MODULATION MSR and 0x12 is calculated from the
Intel 64 and IA-32 Architectures Software Developer?s Manual section
13.5.3. Legal MSR values are 0x12 (12.5% duty cycle) - 0x1E (87.5%) or
0x00 for 100%. I tested it on a quad-core Xeon and it works.

This is somewhat reckless, so use it with caution.

Wes Felter - [email protected]

2009-01-30 01:12:36

by Xiaoning Ding

[permalink] [raw]
Subject: Re: a question about p4_clockmod module on Xeon quad core processors

It works on my machine. Thanks for the help!

Xiaoning


--- On Thu, 1/29/09, Wes Felter <[email protected]> wrote:

> From: Wes Felter <[email protected]>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: [email protected]
> Cc: [email protected]
> Date: Thursday, January 29, 2009, 8:47 PM
> This will give you an effective speed of 250 MHz:
>
> for cpu in 0 1 2 3; do
> cpufreq-set -c $cpu -g userspace
> cpufreq-set -c $cpu -u 2.0GHz
> wrmsr -p $cpu 0x19A 0x12
> done
>
> 0x19A is the IA32_CLOCK_MODULATION MSR and 0x12 is
> calculated from the Intel 64 and IA-32 Architectures
> Software Developer’s Manual section 13.5.3. Legal MSR
> values are 0x12 (12.5% duty cycle) - 0x1E (87.5%) or 0x00
> for 100%. I tested it on a quad-core Xeon and it works.
>
> This is somewhat reckless, so use it with caution.
>
> Wes Felter - [email protected]