amd64/152405: wrong user time is reported when CPU frequency
throttled.
KOIE Hidetaka
koie at suri.co.jp
Fri Nov 19 12:40:06 UTC 2010
>Number: 152405
>Category: amd64
>Synopsis: wrong user time is reported when CPU frequency throttled.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-amd64
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Nov 19 12:40:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: KOIE Hidetaka
>Release: 9.0-CURRENT
>Organization:
surigiken
>Environment:
FreeBSD guriandgura 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Nov 17 15:11:51 JST 2010 root at guriandgura:/usr/obj/museum/freebsd/sys/GURIANDGURA amd64
SVN revision is 215415.
>Description:
when CPU frequency is throttled down, time command reports too low CPU usage like this:
4.849u 0.000s 0:09.13 53.0% 9+5026k 0+0io 0pf+0w
100% is expected, because the process is extreamly CPU-intensive.
wall clock is precise.
systat -vm 1 shows collect user time (25% in 4-core system).
>How-To-Repeat:
koie at guriandgura% cat loop.c
int
main()
{
unsigned long x = 0xffffffffUL;
printf("%lx\n", x);
while (--x > 0)
;
return 0;
}
koie at guriandgura% gcc46 -O loop.c -o loop
loop.c: In function 'main':
loop.c:5:5: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
>Fix:
I don't know.
>Release-Note:
>Audit-Trail:
>Unformatted:
>>>sysctl dev.cpu.0.freq=1800
koie at guriandgura% date ; time ./loop ; date
Fri Nov 19 16:58:27 JST 2010
ffffffff
4.828u 0.000s 0:04.96 97.1% 5+2771k 0+0io 0pf+0w
Fri Nov 19 16:58:32 JST 2010
>>>sysctl dev.cpu.0.freq=1000
koie at guriandgura% date ; time ./loop ; date
Fri Nov 19 16:58:54 JST 2010
ffffffff
4.838u 0.008s 0:09.08 53.1% 9+5037k 0+0io 0pf+0w
NOTE:
53.1% / 97.1% = 0.546.
1000 / 1800 = 0.555.
NOTE:
koie at guriandgura% sysctl kern.sched kern.eventtimer
kern.sched.cpusetsize: 8
kern.sched.preemption: 1
kern.sched.topology_spec: <groups>
<group level="1" cache-level="0">
<cpu count="4" mask="0xf">0, 1, 2, 3</cpu>
<children>
<group level="2" cache-level="2">
<cpu count="2" mask="0x3">0, 1</cpu>
</group>
<group level="2" cache-level="2">
<cpu count="2" mask="0xc">2, 3</cpu>
</group>
</children>
</group>
</groups>
kern.sched.steal_thresh: 2
kern.sched.steal_idle: 1
kern.sched.steal_htt: 1
kern.sched.balance_interval: 127
kern.sched.balance: 1
kern.sched.affinity: 1
kern.sched.idlespinthresh: 16
kern.sched.idlespins: 10000
kern.sched.static_boost: 160
kern.sched.preempt_thresh: 64
kern.sched.interact: 30
kern.sched.slice: 12
kern.sched.name: ULE
kern.eventtimer.choice: LAPIC(400) i8254(100) RTC(0)
kern.eventtimer.et.LAPIC.flags: 15
kern.eventtimer.et.LAPIC.frequency: 100006412
kern.eventtimer.et.LAPIC.quality: 400
kern.eventtimer.et.i8254.flags: 1
kern.eventtimer.et.i8254.frequency: 1193182
kern.eventtimer.et.i8254.quality: 100
kern.eventtimer.et.RTC.flags: 17
kern.eventtimer.et.RTC.frequency: 32768
kern.eventtimer.et.RTC.quality: 0
kern.eventtimer.periodic: 0
kern.eventtimer.timer: LAPIC
kern.eventtimer.idletick: 0
kern.eventtimer.singlemul: 2
koie at guriandgura%
More information about the freebsd-amd64
mailing list