If a process runs in a busy loop, the CPU usage reported in top/ps is wrong. It starts at ~20% and goes down to 0% within a few seconds. The overall CPU usage is reported correctly. Here's the top output: last pid: 22916; load averages: 0.71, 0.48, 0.39 up 0+00:25:47 11:32:57 87 processes: 4 running, 83 sleeping CPU: 96.3% user, 0.0% nice, 3.4% system, 0.4% interrupt, 0.0% idle Mem: 261M Active, 110M Inact, 134M Wired, 1656K Cache, 110M Buf, 482M Free Swap: 1280M Total, 1280M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 22916 stefan 1 98 0 3500K 1684K RUN 0:02 11.18% sh <-- this should be ~100% 22719 stefan 1 44 0 103M 57444K RUN 1:10 0.00% Xorg Only happens with SCHED_ULE. With SCHED_4BSD the reported values look sane. I didn't see this on 8-CURRENT on the same machine when I've tested it about 2 weeks ago. How-To-Repeat: Run a program that uses all available CPU cycles, e.g. $ while true; do true; done Look at CPU usage reported by top or ps.
If I assign idle priority which idprio(1) CPU usage is displayed correctly with SCHED_ULE. I got the idea to use idprio from threads/122923 as I also see the problem reported there. Maybe the PRs are related.
Some more investigation revealed this: If I revert 1.214.2.7 of sched_ule.c the problem disappears. The problem only occurs if dummynet(4) is loaded.
Responsible Changed From-To: freebsd-bugs->jeff Assign to Jeff Roberson, ULE author.
The commit referenced is the MFC to 7.1 of the SVN change 180607. -- John Baldwin
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Just found this very old PR reported by me. The issue is no longer reproducible on my current machine using supported versions of FreeBSD. So I'm closing this bug.