From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 3 06:10:17 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE30916A4CE for ; Thu, 3 Mar 2005 06:10:17 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DAF543D41 for ; Thu, 3 Mar 2005 06:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j236AGrY018421 for ; Thu, 3 Mar 2005 06:10:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j236AG8x018420; Thu, 3 Mar 2005 06:10:16 GMT (envelope-from gnats) Resent-Date: Thu, 3 Mar 2005 06:10:16 GMT Resent-Message-Id: <200503030610.j236AG8x018420@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jari Kirma Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 304A916A4CE for ; Thu, 3 Mar 2005 06:04:47 +0000 (GMT) Received: from hutcs.cs.hut.fi (hutcs.cs.hut.fi [130.233.192.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 243E843D46 for ; Thu, 3 Mar 2005 06:04:46 +0000 (GMT) (envelope-from kirma@cs.hut.fi) Received: from kirma by hutcs.cs.hut.fi with local (Exim 4.30) id 1D6jRy-0000pP-RN for FreeBSD-gnats-submit@freebsd.org; Thu, 03 Mar 2005 08:04:42 +0200 Message-Id: Date: Thu, 03 Mar 2005 08:04:42 +0200 From: Jari Kirma To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/78342: top -S shows potentially incorrect CPU usage for idle thread X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jari Kirma List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2005 06:10:17 -0000 >Number: 78342 >Category: kern >Synopsis: top -S shows potentially incorrect CPU usage for idle thread >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 03 06:10:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Jari Kirma >Release: FreeBSD 5.4-PRERELEASE amd64 >Organization: Helsinki University of Technology >Environment: System: FreeBSD vulcan.tky.hut.fi 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #1: Wed Mar 2 20:48:13 EET 2005 kirma@xxx:/usr/obj/usr/src/sys/XXX amd64 kernel configuration: machine amd64 cpu HAMMER ident XXX options PQ_CACHESIZE=512 options COMPAT_IA32 options COMPAT_LINUX32 options COMPAT_43 options PREEMPTION options MAXDSIZ=(1024UL*1024*1024) options MAXSSIZ=(128UL*1024*1024) options DFLDSIZ=(1024UL*1024*1024) options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols options IPFIREWALL #firewall options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default options IPDIVERT #divert sockets options ZERO_COPY_SOCKETS options NETGRAPH #netgraph(4) system options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options MSDOSFS # MSDOS Filesystem options DIRECTIO options PROCFS # Process filesystem (requires PSEUDOFS) options LINPROCFS options PSEUDOFS # Pseudo-filesystem framework options GEOM_BSD # BSD disklabels options GEOM_GATE # Userland services. options GEOM_LABEL # Providers labelization. options GEOM_MBR # DOS/MBR partitioning options GEOM_VOL # Volume names from UFS superblock options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options ADAPTIVE_GIANT # Giant mutex is adaptive. device acpi # Bus support. Do not remove isa, even if you have no isa slots device isa device pci options AUTO_EOI_1 # ATA and ATAPI devices device ata device atadisk # ATA disk drives options ATA_STATIC_ID # Static device numbering # atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc # AT keyboard controller device atkbd # AT keyboard device vga # VGA video card driver # syscons is the default console driver, resembling an SCO console device sc device agp # support several AGP chipsets device mgadrm # Serial (COM) ports device sio # 8250, 16[45]50 based serial ports device ppbus device lpt device ppi # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support device fxp # Intel EtherExpress PRO/100B (82557, 82558) device rl # RealTek 8129/8139 # Pseudo devices. device loop # Network loopback device mem # Memory and kernel memory devices device io # I/O device device random # Entropy device device ether # Ethernet support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! device bpf # Berkeley packet filter # USB support device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device usb # USB Bus (required) device ugen # Generic device uhid # "Human Interface Devices" device ukbd # Keyboard device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da device ums # Mouse # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) dmesg output: Copyright (c) 1992-2005 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.4-PRERELEASE #1: Wed Mar 2 20:48:13 EET 2005 kirma@xxx:/usr/obj/usr/src/sys/XXX Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Athlon(tm) 64 Processor 3200+ (2211.08-MHz K8-class CPU) Origin = "AuthenticAMD" Id = 0xfc0 Stepping = 0 Features=0x78bfbff AMD Features=0xe0500800 real memory = 536805376 (511 MB) avail memory = 509415424 (485 MB) ACPI APIC Table: ioapic0 irqs 0-23 on motherboard acpi0: on motherboard acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 cpu0: on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 agp0: mem 0xd0000000-0xd7ffffff at device 0.0 on pci0 pcib1: at device 1.0 on pci0 pci1: on pcib1 drm0: mem 0xdb000000-0xdb7fffff,0xda000000-0xda003fff,0xd8000000-0xd9ffffff irq 16 at device 0.0 on pci1 info: [drm] AGP at 0xd0000000 128MB info: [drm] Initialized mga 3.1.0 20021029 on minor 0 fxp0: port 0xc000-0xc01f mem 0xde000000-0xde0fffff,0xde100000-0xde100fff irq 18 at device 10.0 on pci0 miibus0: on fxp0 inphy0: on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp0: Ethernet address: 00:90:27:12:95:fd pci0: at device 13.0 (no driver attached) atapci0: port 0xd400-0xd40f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 15.0 on pci0 ata0: channel #0 on atapci0 ata1: channel #1 on atapci0 uhci0: port 0xd800-0xd81f irq 21 at device 16.0 on pci0 usb0: on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: port 0xdc00-0xdc1f irq 21 at device 16.1 on pci0 usb1: on uhci1 usb1: USB revision 1.0 uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0xe000-0xe01f irq 21 at device 16.2 on pci0 usb2: on uhci2 usb2: USB revision 1.0 uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered ugen0: TechnoTrend AG TT-DVB-C USB, rev 1.00/1.00, addr 2 uhci3: port 0xe400-0xe41f irq 21 at device 16.3 on pci0 usb3: on uhci3 usb3: USB revision 1.0 uhub3: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3: 2 ports with 2 removable, self powered pci0: at device 16.4 (no driver attached) isab0: at device 17.0 on pci0 isa0: on isab0 rl0: port 0xe800-0xe8ff mem 0xde102000-0xde1020ff irq 18 at device 19.0 on pci0 miibus1: on rl0 rlphy0: on miibus1 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto rl0: Ethernet address: 00:0f:ea:57:ef:7e sio0: configured irq 4 not in bitmap of probed irqs 0 sio0: port may not be enabled sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 sio0: type 16550A sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0 sio1: type 16550A atkbdc0: port 0x64,0x60 irq 1 on acpi0 atkbd0: flags 0x1 irq 1 on atkbdc0 kbd0 at atkbd0 orm0: at iomem 0xc0000-0xc8fff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 2211075662 Hz quality 800 Timecounters tick every 1.000 msec ipfw2 initialized, divert enabled, rule-based forwarding disabled, default to accept, logging disabled ad0: 117800MB [239340/16/63] at ata0-master UDMA100 Mounting root from ufs:/dev/ad0s1a IP Filter: v3.4.35 initialized. Default = pass all, Logging = enabled >Description: Idle process never shows more than 92.19% CPU usage, although "CPU states" line would suggest otherwise. Below is a dump of top -Ss30 from idle test system, with all processes that have consumed up to one second. last pid: 70298; load averages: 0.00, 0.00, 0.00 up 0+10:22:31 07:52:07 122 processes: 2 running, 87 sleeping, 33 waiting CPU states: 0.0% user, 0.0% nice, 0.1% system, 0.2% interrupt, 99.7% idle Mem: 144M Active, 220M Inact, 46M Wired, 20M Cache, 60M Buf, 3280K Free Swap: 1024M Total, 9288K Used, 1015M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 11 root 171 52 0K 16K RUN 517:31 91.41% 91.41% idle 29 root -68 -187 0K 16K WAIT 0:39 0.00% 0.00% irq18: fxp0 rl0 36 root -28 -147 0K 16K WAIT 0:33 0.00% 0.00% swi5: clock sio 35 root -44 -163 0K 16K WAIT 0:18 0.00% 0.00% swi1: net 70000 root 76 0 82480K 48764K select 0:15 0.00% 0.00% Xorg 56 root 20 0 0K 16K syncer 0:14 0.00% 0.00% syncer 28 root -80 -199 0K 16K WAIT 0:12 0.00% 0.00% irq17: oss 53 root 171 52 0K 16K pgzero 0:12 0.00% 0.00% pagezero 54 root -16 0 0K 16K psleep 0:11 0.00% 0.00% bufdaemon 4 root -8 0 0K 16K - 0:08 0.00% 0.00% g_down 3 root -8 0 0K 16K - 0:06 0.00% 0.00% g_up 70083 kirma 20 0 165M 59852K kserel 0:06 0.00% 0.00% mozilla-bin 38 root -16 0 0K 16K - 0:03 0.00% 0.00% yarrow 25 root -64 -183 0K 16K WAIT 0:02 0.00% 0.00% irq14: ata0 524 root 76 0 2504K 532K select 0:02 0.00% 0.00% moused 51 root -16 0 0K 16K psleep 0:01 0.00% 0.00% pagedaemon 651 kirma 76 0 29456K 1580K select 0:01 0.00% 0.00% sshd 70047 kirma 76 0 80228K 15444K select 0:01 0.00% 0.00% xfce4-panel 70265 kirma 76 0 43252K 17012K select 0:01 0.00% 0.00% emacs 2 root -8 0 0K 16K - 0:01 0.00% 0.00% g_event 396 root 76 0 7676K 1140K select 0:01 0.00% 0.00% ntpd 70051 kirma 76 0 76116K 14628K select 0:01 0.00% 0.00% xfdesktop 475 dhcpd 76 0 4068K 1152K select 0:01 0.00% 0.00% dhcpd 70045 kirma 76 0 54636K 10460K select 0:01 0.00% 0.00% xfwm4 >How-To-Repeat: Run top -S on idle system and observe. >Fix: Unknown. >Release-Note: >Audit-Trail: >Unformatted: