Time granularity in microseconds is sometimes not enough to provide
accurate bandwidth control; actual bandwidth on a capped class
can exceed its limit considerably in some cases.
Treating time in nanoseconds requires the following changes:
- Use timespec instead of timeval
- Use nanotime(9) instead of microtime(9)
- Change the type of some variables, especially *idle, to long
Also the type of variables of it is changed to u_long from int.
This change provides fine-grain resolution of bandwidth. For example
750 Mbps was treated as 800 Mbps internally because bandwidth was
represented as nanoseconds per byte. Converting the representation
to picoseconds per byte enables to treat 750 Mbps as-is.
PR kern/56319