Bug 456437 - [RHEL5.2-Z][kernel-xen] powernow identifies the wrong number of processors.
[RHEL5.2-Z][kernel-xen] powernow identifies the wrong number of processors.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen (Show other bugs)
5.2.z
All Linux
low Severity low
: rc
: ---
Assigned To: Miroslav Rezanina
Martin Jenner
http://rhts.redhat.com/testlogs/25754...
: Reopened
Depends On:
Blocks: 492568
  Show dependency treegraph
 
Reported: 2008-07-23 12:07 EDT by Jeff Burke
Modified: 2009-09-02 05:00 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 05:00:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeff Burke 2008-07-23 12:07:20 EDT
Description of problem:

===================================================================
diff -u /mnt/testarea/boot.kernel-2.6.18-92.el5
/mnt/testarea/boot.kernel-xen-2.6.18-92.1.10.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):
2.6.18-92.1.10.el5xen

How reproducible:
Always

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 11:09:15 EST
Will re-assign to jdeguara@redhat.com when account is active on BZ.

P.
Comment 6 Rik van Riel 2009-01-12 12:25:31 EST
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 09:53:27 EST
Rik,
  It does happen with the 5.3 kernel-xen

http://rhts.redhat.com/testlogs/40043/136743/1147881/DMSGDIFF.Xr3631.gz

===================================================================
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 13:45:25 EST
Bhavna, any update on this? Are you working on it?
Comment 9 Bhavna Sarathy 2009-03-10 10:06:58 EDT
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)

#ifdef CONFIG_SMP
        printk(KERN_INFO PFX "Found %d %s "
               "processors (%d cpu cores) (" VERSION ")\n",
               supported_cpus/cpu_data[0].booted_cores,
               boot_cpu_data.x86_model_id, supported_cpus);
#else
        printk(KERN_INFO PFX "Found 1 %s "
               "processors (%d cpu cores) (" VERSION ")\n",
               boot_cpu_data.x86_model_id, supported_cpus);
#endif

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?

Bhavna
Comment 10 Bill Burns 2009-03-10 12:53:33 EDT
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 11:48:28 EDT
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().
         */
        /*lock_ipi_call_lock();*/
        cpu_set(smp_processor_id(), cpu_online_map);
        /*unlock_ipi_call_lock();*/
        /*per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;*/
Comment 13 Miroslav Rezanina 2009-04-09 06:11:00 EDT
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 08:29:20 EDT
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 15:34:16 EDT
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 05:00:21 EDT
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.

http://rhn.redhat.com/errata/RHSA-2009-1243.html

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