freebsd_amp_hwpstate/sys/kern
David Greenman 7c818168d5 Fixed a major bug that caused various pmap related panics, hangs, and reboots.
The i386 pmap module uses a special area of kernel virtual memory for mapping
of page tables pages when it needs to modify another process's virtual
address space. It's called the 'alternate page table map'. There is only one
of them and it's expected that only one process will be using it at once and
that the operation is atomic.
When the merged VM/buffer cache was implemented over a year ago, it became
necessary to rundown VM pages at I/O completion. The unfortunate and
unforeseen side effect of this is that pmap functions are now called at bio
interrupt time. If there happend to be a process using the alternate page
table map when this I/O completion occurred, it was possible for a different
process's address space to be switched into the alternate page table map -
leaving the current pmap process with the wrong address space mapped when
the interrupt completed. This resulted in BAD things happening like pages
being mapped or removed from the wrong address space, etc.. Since a very
common case of a process modifying another process's address space is during
fork when the kernel stack is inserted, one of the most common manifestations
of this bug was the kernel stack not being mapped properly, resulting in a
silent hang or reboot. This made it VERY difficult to troubleshoot this bug
(I've been trying to figure out the cause of this for >6 months). Fortunately,
the set of conditions that must be true before this problem occurs is
sufficiently rare enough that most people never saw the bug occur. As I/O
rates increase, however, so does the frequency of the crashes. This problem
used to kill wcarchive about every 10 days, but in more recent times when
the traffic exceeded >100GB/day, the machine could barely manage 6 hours of
uptime.
The fix is to make certain that no process has the pages mapped that are
involved in the I/O, before the I/O is started. The pages are made busy, so
no process will be able to map them, either, until the I/O has finished.
This side-steps the issue by still allowing the pmap functions to be called
at interrupt time, but also assuring that the alternate page table map won't
be switched.
Unfortunately, this appears to not be the only cause of this problem. :-(

Reviewed by:	dyson
1996-06-30 05:17:08 +00:00
..
Make.tags.inc
Makefile
imgact_aout.c
imgact_elf.c
imgact_gzip.c
imgact_shell.c
inflate.c
init_main.c
init_sysent.c
init_sysvec.c
kern_acct.c
kern_clock.c Unstaticize psratio and staticize profprocs. psratio needs to be exported 1996-06-23 17:40:47 +00:00
kern_conf.c
kern_descrip.c
kern_devconf.c
kern_exec.c
kern_exit.c
kern_fork.c
kern_ktrace.c
kern_lkm.c
kern_lockf.c
kern_malloc.c
kern_mib.c
kern_ntptime.c
kern_physio.c Fix a problem that caused system crashes after physio. This problem 1996-06-26 05:52:15 +00:00
kern_proc.c
kern_prot.c
kern_random.c
kern_resource.c
kern_sig.c
kern_subr.c
kern_synch.c
kern_sysctl.c
kern_tc.c Unstaticize psratio and staticize profprocs. psratio needs to be exported 1996-06-23 17:40:47 +00:00
kern_time.c
kern_timeout.c Unstaticize psratio and staticize profprocs. psratio needs to be exported 1996-06-23 17:40:47 +00:00
kern_xxx.c
makesyscalls.sh
md5c.c
subr_autoconf.c
subr_clist.c
subr_disklabel.c
subr_diskmbr.c
subr_diskslice.c
subr_dkbad.c
subr_log.c
subr_param.c
subr_prf.c
subr_prof.c
subr_rlist.c
subr_trap.c trap.c: 1996-06-25 20:02:16 +00:00
subr_xxx.c
sys_generic.c
sys_pipe.c
sys_process.c
sys_socket.c
syscalls.c
syscalls.master
sysv_ipc.c
sysv_msg.c
sysv_sem.c
sysv_shm.c
tty.c
tty_compat.c
tty_conf.c
tty_cons.c
tty_pty.c
tty_snoop.c
tty_subr.c
tty_tb.c
tty_tty.c
uipc_domain.c
uipc_mbuf.c
uipc_proto.c
uipc_sockbuf.c
uipc_socket.c
uipc_socket2.c
uipc_syscalls.c
uipc_usrreq.c
vfs_bio.c Fixed a major bug that caused various pmap related panics, hangs, and reboots. 1996-06-30 05:17:08 +00:00
vfs_cache.c
vfs_cluster.c
vfs_conf.c
vfs_export.c
vfs_extattr.c
vfs_init.c
vfs_lookup.c
vfs_mount.c
vfs_subr.c
vfs_syscalls.c
vfs_vnops.c
vnode_if.pl
vnode_if.sh
vnode_if.src