From: "Darrick J. Wong" <djwong@us.ibm.com>
To: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Cc: Dave Jones <davej@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: Dependent CPU core speed reporting not updated withCPUFREQ_SHARED_TYPE_HW?
Date: Mon, 4 Jun 2007 10:07:39 -0700 [thread overview]
Message-ID: <20070604170738.GB12782@tree.beaverton.ibm.com> (raw)
In-Reply-To: <653FFBB4508B9042B5D43DC9E18836F5F5B144@scsmsx415.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2989 bytes --]
On Sat, Jun 02, 2007 at 07:19:03AM -0700, Pallipadi, Venkatesh wrote:
> The problem here is that with hardware coordination, kernel need not
> do what we do for affected_cpus today. Kernel can manage each CPU
> independently in terms of setting freq as underlying hardware
> guarantees to do the coordination (picking up the highest freq
> among a group of dependent cpus). So ideally we can just manage cpu
> frequencies as we do today without affected_cpus. But, in this case
> there is a fyi from hardware which says even though OS is thinking that
> CPUs are independent, hardware is doing the coordination across these
> CPUs.
Yes, and ... it appears that (at least on Intel CPUs), writing
IA32_PERF_CTL on any core in the package causes the speed of all CPUs to
be set to the max of all CPU cores. Here's what I see when
reading/writing the performance control MSRs:
This is with all CPUs set to 2.6GHz. 0x198 = IA32_PERF_STATUS, 0x199 =
IA32_PERF_CTL.
root@elm3a188:/mnt/src/msr/msr-20060208# ./msr -n 0x198 0x199
CPU 0:
0x00000198 = 0x0828082806000828
0x00000199 = 0x0000000000000828
CPU 1:
0x00000198 = 0x0828082806000828
0x00000199 = 0x0000000000000828
Now, we set scaling_max_freq of CPU 0 to 2GHz:
root@elm3a188:/mnt/src/msr/msr-20060208# ./msr -n 0x198 0x199
CPU 0:
0x00000198 = 0x0828082806000828
0x00000199 = 0x000000000000061a
CPU 1:
0x00000198 = 0x0828082806000828
0x00000199 = 0x0000000000000828
And now likewise for CPU 1:
root@elm3a188:/mnt/src/msr/msr-20060208# ./msr -n 0x198 0x199
CPU 0:
0x00000198 = 0x082808280600061a
0x00000199 = 0x000000000000061a
CPU 1:
0x00000198 = 0x082808280600061a
0x00000199 = 0x000000000000061a
Notice that we've written the slower speed to the control register but
the status register says that we're still running at the higher speed.
This seems to corroborate my finding that the power use does not drop
until _both_ cores are lowered. Unfortunately, in that middle step we
are reporting an incorrect frequency for CPU 0--sysfs says 2GHz but the
hardware itself says 2.6. This is clearly a bad thing, because I just
set scaling_max_cpufreq on CPU0 to 2GHz, yet it is running 667MHz faster
than it ought to be because CPU1 wants to go faster.
How about this: When hardware coordination is specified in _PSD,
scaling_{min,max}_freq between CPUs in a cpufreq domain are tied
together so that we can be sure that our caps are being followed.
Requests to change speed can be done as they always have, but
afterwards the value of scaling_cur_freq for all CPUs in the cpufreq
domain will be determined by reading the speed value from hardware
since we can't really be sure how the hardware decided to coordinate
things anyway. When it becomes the case that individual cores on a
package can run at different speeds, we can drop the _PSD entries. Does
this scheme sound reasonable?
We might, however, want another sysfs file to tell userspace what kind
of coordination is taking place.
--D
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-06-04 17:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-30 0:43 Dependent CPU core speed reporting not updated with CPUFREQ_SHARED_TYPE_HW? Darrick J. Wong
2007-03-30 1:06 ` Pallipadi, Venkatesh
2007-06-01 18:43 ` Darrick J. Wong
2007-06-01 21:37 ` Andi Kleen
2007-06-01 22:39 ` Darrick J. Wong
2007-06-02 1:59 ` Pallipadi, Venkatesh
2007-06-02 6:43 ` Dave Jones
2007-06-02 14:19 ` Dependent CPU core speed reporting not updated withCPUFREQ_SHARED_TYPE_HW? Pallipadi, Venkatesh
2007-06-04 17:07 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070604170738.GB12782@tree.beaverton.ibm.com \
--to=djwong@us.ibm.com \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=venkatesh.pallipadi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®