rusage breakdown and cpu limits.

Kip Macy kip.macy at gmail.com
Tue May 29 19:04:49 UTC 2007


> I think using a per-process spin lock (or a pool of spin locks) would be a
> good first step.  I wouldn't do anything more complicated unless the simple
> approach doesn't work.  The only reason to not move the check into userret()
> would be if one is worried about threads chewing up CPU time while they are
> in the kernel w/o bouncing out to userland.  Also, it matters which one
> happens more often (userret() vs mi_switch()).  If on average threads perform
> multiple system calls during a single time slice (no idea if this is true or
> not), then moving the check to userret() would actually hurt performance.

Processes can certainly make numerous system calls within a single
time slice. However, in userret it would be protected by a per process
or per thread blocking mutex as opposed to a global spin mutex. It
would be surprising if it isn't a net win, although it is quite
possible that on a 2-way system the extra locking could have an
adverse effect on some workloads.

 -Kip


More information about the freebsd-arch mailing list