This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 442801

Summary: mpstat shows one extra cpu
Product: [Fedora] Fedora Reporter: Chris Wright <chrisw>
Component: sysstatAssignee: Ivana Varekova <varekova>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: agentunix, roland
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 8.0.4-4.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-17 18:27:47 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 235705    
Attachments:
Description Flags
get_sys_cpu_nr account for cpuidle/ dir none

Description Chris Wright 2008-04-16 17:20:02 EDT
Description of problem:

mpstat shows one extra cpu

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

sysstat-8.0.4-3.fc9.x86_64

How reproducible:

Very (if /sys is mounted)

Steps to Reproduce:
1. mpstat -P ALL
  
Actual results:

output show one extra cpu (quad core sample output):
Linux 2.6.25-0.204.rc8.git4.fc9.x86_64 (localhost.localdomain)  04/16/2008

02:07:41 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle
   intr/s
02:07:41 PM  all    0.36    0.03    0.14    0.03    0.00    0.00    0.00   99.44
     6.23
02:07:41 PM    0    0.07    0.01    0.03    0.01    0.00    0.00    0.00   99.88
     0.44
02:07:41 PM    1    0.97    0.02    0.30    0.02    0.00    0.00    0.00   98.69
     0.60
02:07:41 PM    2    0.20    0.01    0.10    0.03    0.00    0.00    0.00   99.65
     2.02
02:07:41 PM    3    0.20    0.06    0.13    0.05    0.00    0.00    0.00   99.56
     3.17
02:07:41 PM    4    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00
     0.00

Note the seemingly unused cpu4.

Expected results:
stats for all plus cpu0-3 on the example quadcore system

Additional info:

This is a result of get_sys_cpu_nr making the assumption that any dir:
/sys/devices/system/cpu/cpu*/ represents a cpu thread.  However there is at
least /sys/devices/system/cpu/cpuidle/ which makes get_sys_cpu_nr return one too
many cpus.  Patch below is tested and works fine here.
Comment 1 Chris Wright 2008-04-16 17:20:02 EDT
Created attachment 302675 [details]
get_sys_cpu_nr account for cpuidle/ dir
Comment 2 Zachary Napora 2008-04-22 00:15:26 EDT
The bug is easily reproducible in current rawhide and a patch has been
provided(works for me, thanks).
Note that this bug has been added to the F9Target tracker.
Changing status to ASSIGNED.
Comment 3 Ivana Varekova 2008-04-23 05:14:27 EDT
Thanks. Fixed in sysstat-8.0.4-4.fc9, sysstat-8.0.4-4.fc10.
Comment 4 Fedora Update System 2008-04-30 03:17:44 EDT
sysstat-8.0.4-4.fc9 has been submitted as an update for Fedora 9
Comment 5 Fedora Update System 2008-05-13 11:24:11 EDT
sysstat-8.0.4-4.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sysstat'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-3689
Comment 6 Bug Zapper 2008-05-14 05:32:59 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Fedora Update System 2008-05-17 18:27:45 EDT
sysstat-8.0.4-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Ivana Varekova 2008-08-18 03:36:36 EDT
*** Bug 459377 has been marked as a duplicate of this bug. ***