Bug 456437 - [RHEL5.2-Z][kernel-xen] powernow identifies the wrong number of processors.
Summary: [RHEL5.2-Z][kernel-xen] powernow identifies the wrong number of processors.
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.2.z
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Miroslav Rezanina
QA Contact: Martin Jenner
URL: http://rhts.redhat.com/testlogs/25754...
Depends On:
Blocks: 492568
TreeView+ depends on / blocked
Reported: 2008-07-23 16:07 UTC by Jeff Burke
Modified: 2009-09-02 09:00 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-09-02 09:00:21 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1243 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.4 kernel security and bug fix update 2009-09-01 08:53:34 UTC

Description Jeff Burke 2008-07-23 16:07:20 UTC
Description of problem:

diff -u /mnt/testarea/boot.kernel-2.6.18-92.el5
--- /mnt/testarea/boot.kernel-2.6.18-92.el5	2008-07-23 07:22:29.000000000 -0400
+++ /mnt/testarea/boot.kernel-xen-2.6.18-92.1.10.el5	2008-07-23
07:26:56.000000000 -0400
@@ -1,31 +1,14 @@
-Linux version 2.6.18-92.el5 (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc
version 4.1.2 20071124 (Red Hat 4.1.2-41)) #1 SMP Tue Apr 29 13:16:12 EDT 2008
+Linux version 2.6.18-92.1.10.el5xen (brewbuilder@hs20-bc1-7.build.redhat.com)
(gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Wed Jul 23 04:25:48 EDT 2008
-powernow-k8: Found 4 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8
cpu cores) (version 2.20.00)
+powernow-k8: Found 8 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8
cpu cores) (version 2.20.00)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Boot 2.6.18-92.1.10.el5xen on hp-dl585g2-01.rhts.bos.redhat.com
Actual results:
powernow-k8: Found 8 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8
cpu cores) (version 2.20.00)

Expected results:
powernow-k8: Found 4 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8
cpu cores) (version 2.20.00)

Additional info:
I am not sure if this is new with the 5.2-Z stream kernels or if is a
regression. It may have been an issue with 5.2 GA xen kernel.

Comment 4 Prarit Bhargava 2008-11-06 16:09:15 UTC
Will re-assign to jdeguara@redhat.com when account is active on BZ.


Comment 6 Rik van Riel 2009-01-12 17:25:31 UTC
RHEL 5.3 has some fixes in this area.  Jeff, does the bug happen with the 5.3 kernel-xen?

Comment 7 Jeff Burke 2009-01-19 14:53:27 UTC
  It does happen with the 5.3 kernel-xen


diff -u /mnt/testarea/boot.kernel-2.6.18-126.el5 /mnt/testarea/boot.kernel-xen-2.6.18-128.el5
--- /mnt/testarea/boot.kernel-2.6.18-126.el5	2008-12-17 18:12:32.000000000 -0500
+++ /mnt/testarea/boot.kernel-xen-2.6.18-128.el5	2008-12-17 18:17:46.000000000 -0500
@@ -1,31 +1,14 @@
-Linux version 2.6.18-126.el5 (mockbuild@hs20-bc1-2.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Mon Dec 8 18:33:05 EST 2008
+Linux version 2.6.18-128.el5xen (mockbuild@hs20-bc1-5.build.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Wed Dec 17 12:22:24 EST 2008
-powernow-k8: Found 4 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8 cpu cores) (version 2.20.00)
+powernow-k8: Found 8 Dual-Core AMD Opteron(tm) Processor 8220 SE processors (8 cpu cores) (version 2.20.00)

Comment 8 Bill Burns 2009-02-24 18:45:25 UTC
Bhavna, any update on this? Are you working on it?

Comment 9 Bhavna Sarathy 2009-03-10 14:06:58 UTC
I recall fixing this issue in bare metal with the following snippet (sorry I couldn't find the exact patch on the maling list archive)

        printk(KERN_INFO PFX "Found %d %s "
               "processors (%d cpu cores) (" VERSION ")\n",
               boot_cpu_data.x86_model_id, supported_cpus);
        printk(KERN_INFO PFX "Found 1 %s "
               "processors (%d cpu cores) (" VERSION ")\n",
               boot_cpu_data.x86_model_id, supported_cpus);

This identifies the number of processors and not the number of cores.  AFAICT, there is no Xen specific powernow-k8 driver, it uses the dom0 driver in arch/i386/kernel/cpu/cpufreq/powernow-k8.c, and the fix that went in RHEL5.1 should apply.

Am I missing something?


Comment 10 Bill Burns 2009-03-10 16:53:33 UTC
Well from the problem description the cpu_data[0].booted_cores would seem to be wrong on the Xen kernel. If it's 2 then the output would be "4 dual core..." and "8 cpu cores". We are getting 8 and 8 on Xen.

Comment 11 Bhavna Sarathy 2009-03-27 15:48:28 UTC
I have looked through the Xen core enumeration code and noted right away that the code base was taken from Linux i386 and not x86_64.   Majority of the code is identical, with no major missing pieces, except for this snippet that is 
mostly commented.  Bill, can you CC comeone who can comment on this?

         * We need to hold call_lock, so there is no inconsistency
         * between the time smp_call_function() determines number of
         * IPI receipients, and the time when the determination is made
         * for which cpus receive the IPI. Holding this
         * lock helps us to not include this cpu in a currently in progress
         * smp_call_function().
        cpu_set(smp_processor_id(), cpu_online_map);
        /*per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;*/

Comment 13 Miroslav Rezanina 2009-04-09 10:11:00 UTC
This behavior is caused by Xen functionality. Xen takes true topology and provides to each dom (including dom0) only one-cored proccesors. So dom0 gets in this case 8 processors with 1 core each. However, this processors have original name.

Should be behavior of xen smp driver modified to see original number of cores when running in dom0??

Comment 14 Jeff Burke 2009-05-04 12:29:20 UTC
Yes it should be fixed because it is incorrect. It is also inconsistent with a standard kernel. Note: Comment #7

Comment 16 Don Zickus 2009-05-14 19:34:16 UTC
in kernel-2.6.18-148.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so.  However feel free
to provide a comment indicating that this fix has been verified.

Comment 19 errata-xmlrpc 2009-09-02 09:00:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.