Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

a question about p4_clockmod module on Xeon quad core processors

6 views
Skip to first unread message

Xiaoning Ding

unread,
Jan 27, 2009, 3:23:32 PM1/27/09
to linux-...@vger.kernel.org
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Arjan van de Ven

unread,
Jan 27, 2009, 4:23:47 PM1/27/09
to din...@ymail.com, linux-...@vger.kernel.org
On Tue, 27 Jan 2009 12:17:25 -0800 (PST)
Xiaoning Ding <din...@ymail.com> 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

Dave Jones

unread,
Jan 28, 2009, 4:02:28 PM1/28/09
to Xiaoning Ding, linux-...@vger.kernel.org
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

Wes Felter

unread,
Jan 28, 2009, 4:06:35 PM1/28/09
to din...@ymail.com, linux-...@vger.kernel.org
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 - wes...@felter.org

Xiaoning Ding

unread,
Jan 28, 2009, 9:06:55 PM1/28/09
to Dave Jones, linux-...@vger.kernel.org
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 <da...@redhat.com> wrote:

Xiaoning Ding

unread,
Jan 28, 2009, 9:12:00 PM1/28/09
to Wes Felter, linux-...@vger.kernel.org
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 <wes...@felter.org> wrote:

> From: Wes Felter <wes...@felter.org>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: din...@ymail.com
> Cc: linux-...@vger.kernel.org

Dave Jones

unread,
Jan 28, 2009, 9:45:59 PM1/28/09
to Xiaoning Ding, linux-...@vger.kernel.org
[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.

Michael Tokarev

unread,
Jan 29, 2009, 7:27:48 AM1/29/09
to Dave Jones, Xiaoning Ding, linux-...@vger.kernel.org
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

Xiaoning Ding

unread,
Jan 29, 2009, 11:12:26 AM1/29/09
to Arjan van de Ven, linux-...@vger.kernel.org
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 <ar...@infradead.org> wrote:

> From: Arjan van de Ven <ar...@infradead.org>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors
> To: din...@ymail.com
> Cc: linux-...@vger.kernel.org

Xiaoning Ding

unread,
Jan 29, 2009, 11:33:01 AM1/29/09
to Dave Jones, linux-...@vger.kernel.org


--- On Thu, 1/29/09, Dave Jones <da...@redhat.com> wrote:

> From: Dave Jones <da...@redhat.com>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors

> To: "Xiaoning Ding" <din...@ymail.com>
> Cc: linux-...@vger.kernel.org

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 Jones

unread,
Jan 29, 2009, 12:09:26 PM1/29/09
to Xiaoning Ding, linux-...@vger.kernel.org
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 Jones

unread,
Jan 29, 2009, 12:24:36 PM1/29/09
to Michael Tokarev, Xiaoning Ding, linux-...@vger.kernel.org
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

Xiaoning Ding

unread,
Jan 29, 2009, 2:40:45 PM1/29/09
to Michael Tokarev, Dave Jones, linux-...@vger.kernel.org
--- On Thu, 1/29/09, Dave Jones <da...@redhat.com> wrote:

> From: Dave Jones <da...@redhat.com>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors

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

Wes Felter

unread,
Jan 29, 2009, 3:47:29 PM1/29/09
to din...@ymail.com, linux-...@vger.kernel.org
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.

Xiaoning Ding

unread,
Jan 29, 2009, 8:12:44 PM1/29/09
to Wes Felter, linux-...@vger.kernel.org
It works on my machine. Thanks for the help!

Xiaoning


--- On Thu, 1/29/09, Wes Felter <wes...@felter.org> wrote:

> From: Wes Felter <wes...@felter.org>
> Subject: Re: a question about p4_clockmod module on Xeon quad core processors

0 new messages