freebsd-skq/sys
John Baldwin 78c85e8dfc Rework how we store process times in the kernel such that we always store
the raw values including for child process statistics and only compute the
system and user timevals on demand.

- Fix the various kern_wait() syscall wrappers to only pass in a rusage
  pointer if they are going to use the result.
- Add a kern_getrusage() function for the ABI syscalls to use so that they
  don't have to play stackgap games to call getrusage().
- Fix the svr4_sys_times() syscall to just call calcru() to calculate the
  times it needs rather than calling getrusage() twice with associated
  stackgap, etc.
- Add a new rusage_ext structure to store raw time stats such as tick counts
  for user, system, and interrupt time as well as a bintime of the total
  runtime.  A new p_rux field in struct proc replaces the same inline fields
  from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime).  A new p_crux
  field in struct proc contains the "raw" child time usage statistics.
  ruadd() has been changed to handle adding the associated rusage_ext
  structures as well as the values in rusage.  Effectively, the values in
  rusage_ext replace the ru_utime and ru_stime values in struct rusage.  These
  two fields in struct rusage are no longer used in the kernel.
- calcru() has been split into a static worker function calcru1() that
  calculates appropriate timevals for user and system time as well as updating
  the rux_[isu]u fields of a passed in rusage_ext structure.  calcru() uses a
  copy of the process' p_rux structure to compute the timevals after updating
  the runtime appropriately if any of the threads in that process are
  currently executing.  It also now only locks sched_lock internally while
  doing the rux_runtime fixup.  calcru() now only requires the caller to
  hold the proc lock and calcru1() only requires the proc lock internally.
  calcru() also no longer allows callers to ask for an interrupt timeval
  since none of them actually did.
- calcru() now correctly handles threads executing on other CPUs.
- A new calccru() function computes the child system and user timevals by
  calling calcru1() on p_crux.  Note that this means that any code that wants
  child times must now call this function rather than reading from p_cru
  directly.  This function also requires the proc lock.
- This finishes the locking for rusage and friends so some of the Giant locks
  in exit1() and kern_wait() are now gone.
- The locking in ttyinfo() has been tweaked so that a shared lock of the
  proctree lock is used to protect the process group rather than the process
  group lock.  By holding this lock until the end of the function we now
  ensure that the process/thread that we pick to dump info about will no
  longer vanish while we are trying to output its info to the console.

Submitted by:	bde (mostly)
MFC after:	1 month
2004-10-05 18:51:11 +00:00
..
alpha Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
amd64 Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
arm Add optimized version of the bswap macroes for constants if __OPTIMIZED__ is 2004-10-01 16:55:59 +00:00
boot Back out changes which were introduced to delay mounting root file system. 2004-10-05 11:26:43 +00:00
cam Remove the camnet swi and CAM_PERIPH_NET. It has never been used, and given 2004-10-05 04:22:20 +00:00
coda Do not use devsw() but si_devsw direction. This is still bogus but a 2004-09-23 12:19:24 +00:00
compat Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
conf Add a more verbose description for `device vlan' 2004-10-04 14:16:17 +00:00
contrib Add an additional struct inpcb * argument to pfil(9) in order to enable 2004-09-29 04:54:33 +00:00
crypto
ddb Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
dev Use generic tty code instead of local copy. 2004-10-05 07:42:19 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
gdb Comment-out the debugging printf I left in in case there were some 2004-08-10 19:32:33 +00:00
geom Before root file system is mounted, wait for mirrors in degraded state. 2004-10-05 11:17:08 +00:00
gnu Desupport device nodes on EXT2 filesystems. 2004-09-27 20:38:46 +00:00
i4b Kill count device support from config. I've changed the last few 2004-08-30 23:03:58 +00:00
i386 Undo revision 1.251. This change was a performance pessimizing work-around 2004-10-03 20:14:07 +00:00
ia64 The physical address stored in the vm_page is page aligned. There is no 2004-10-03 00:16:43 +00:00
isa Introduce a tunable to disable support for Synaptics touchpads. A number of 2004-09-29 23:49:57 +00:00
isofs/cd9660 Hold proper thread count while frobbing drivers ioctl. 2004-09-24 07:24:02 +00:00
kern Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
libkern Don't attempt to profile __udivsi3() and friends, as mcount() uses them. 2004-10-01 16:44:08 +00:00
modules Add the memrange bits to the loadable module. 2004-09-28 07:26:00 +00:00
net Add an additional struct inpcb * argument to pfil(9) in order to enable 2004-09-29 04:54:33 +00:00
net80211 Add a new network interface flag, IFF_NEEDSGIANT, which will allow 2004-07-27 23:20:45 +00:00
netatalk Inline umich license from COPYRIGHT to make it clear what license the 2004-08-10 03:23:05 +00:00
netatm Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
netgraph Fix an issue with ng_tty which (ab)used the tty->t_sc field which is 2004-09-17 22:26:27 +00:00
netinet - Estimate the amount of data in flight in sack recovery and use it 2004-10-05 18:36:24 +00:00
netinet6 Prevent reentrancy of the IPv6 routing code (leading to crash with 2004-10-03 00:49:33 +00:00
netipsec Remove extraneous SECPOLICY_LOCK_DESTROY calls that cause the mutex to be 2004-10-02 00:19:05 +00:00
netipx Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correct 2004-08-28 15:24:53 +00:00
netkey Merge netipsec/key.c:1.17 into KAME pfkey implementation: 2004-09-30 00:49:55 +00:00
netnatm Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
netncp Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
netsmb Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfs
nfs4client Remove NFS4 vop method vector for devices: we are desupporing device nodes 2004-09-27 20:02:50 +00:00
nfsclient nfsclient/nfs_bio.c has a PHOLD() without a PRELE(). Neither should 2004-10-01 05:01:41 +00:00
nfsserver Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to 2004-08-25 16:52:59 +00:00
opencrypto Don't acquire Giant in cryptof_close(), as the code is intended to be 2004-08-10 03:26:17 +00:00
pc98 Add more PnP serial cards support. 2004-10-01 15:58:54 +00:00
pccard Move PNP IDs back into oldcard files 2004-08-13 06:57:31 +00:00
pci Add PCI ID for VIA K8T800Pro chipset. Tested with agptest and X with DRI 2004-10-05 04:40:32 +00:00
posix4
powerpc Add sc_iostart to softc and unbreak the build. 2004-09-27 19:51:58 +00:00
rpc Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-23 18:25:46 +00:00
security Remove the debugging tunable, it was not being used. 2004-09-10 15:14:50 +00:00
sparc64 This along with v1.6 of counter.c fixes some timecounter issues on 2004-09-30 14:38:59 +00:00
sys Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
tools Pass doxygen doc comments through to the output. 2004-07-11 16:14:24 +00:00
ufs Back out changes which were introduced to delay mounting root file system. 2004-10-05 11:26:43 +00:00
vm Don't look for swap blocks in objects that aren't swap-backed. 2004-09-24 16:04:20 +00:00
Makefile Add a NO_BOOT knob to prevent building the boot blocks and loader. 2004-08-19 09:54:28 +00:00