Bug 236096

Summary: top shows WCPU numbers greater than 100 percent when using SCHED_BSD
Product: Base System Reporter: Ian Lepore <ian>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People    
Priority: ---    
Version: 12.0-STABLE   
Hardware: amd64   
OS: Any   

Description Ian Lepore freebsd_committer freebsd_triage 2019-02-28 01:12:41 UTC
After switching from SCHED_ULE to SCHED_4BSD I immediately noticed that top displays wildly inaccurate numbers for WCPU.  If you switch the display to un-weighted CPU the numbers are mostly right (rarely you'll see a 101% type number).  This is on a 6-core/12-thread system running make universe:

last pid: 93675;  load averages: 11.55, 12.01, 11.34    up 0+09:47:22  18:07:54
277 processes: 12 running, 265 sleeping
CPU:  0.3% user, 71.7% nice,  5.8% system,  0.1% interrupt, 22.2% idle
Mem: 2727M Active, 6622M Inact, 144M Laundry, 1978M Wired, 1174M Buf, 533M Free
Swap: 32G Total, 32G Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
93198 ilepore       1  95   20   101M    71M CPU6     6   0:02 1669.79% cc
93380 ilepore       1  95   20    80M    50M RUN      8   0:01 1092.95% cc
93366 ilepore       1  95   20    80M    51M CPU2     2   0:01 1090.72% cc
93381 ilepore       1  95   20    80M    50M CPU0     0   0:01 1075.67% cc
93365 ilepore       1  95   20    80M    50M CPU10   10   0:01 1075.13% cc
93367 ilepore       1  95   20    80M    50M CPU5     5   0:01 1031.28% cc
93378 ilepore       1  95   20    80M    50M CPU9     9   0:01 1027.59% cc
93379 ilepore       1  95   20    80M    50M CPU7     7   0:01 1026.13% cc
93324 ilepore       1  95   20    11M  1920K select   8   0:00  22.64% make
93329 ilepore       1  95   20    11M  1916K select   8   0:00  22.53% make
93328 ilepore       1  95   20    11M  1920K select  11   0:00  22.10% make
93302 ilepore       1  95   20    11M  1916K select   8   0:00  22.02% make
93308 ilepore       1  95   20    11M  1920K select   5   0:00  19.93% make
93233 ilepore       1  93   20    11M  1920K select   2   0:00  17.88% make
93298 ilepore       1  95   20    11M  1920K select   2   0:00  16.95% make
93353 ilepore       1   8   20    66M    35M wait     2   0:00   4.06% cc
93377 ilepore       1   8   20    66M    35M wait     6   0:00   3.95% cc
93376 ilepore       1   8   20    66M    35M wait     6   0:00   3.90% cc


revolution > uname -a
FreeBSD revolution.hippie.lan 12.0-STABLE FreeBSD 12.0-STABLE r342853 REVOLUTION12  amd64