kernel - Major signal path adjustments to fix races, tsleep race fixes, +more
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Nov 2011 23:23:41 +0000 (15:23 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Nov 2011 23:23:41 +0000 (15:23 -0800)
commit4643740aa6f3eac7d3dfab05967ec55b5d8ba984
tree38c3f2f3ee99b15d241cdf5c99cc5a61b090c098
parent5ef517efea99b1ff1017542da71250864793d0c0
kernel - Major signal path adjustments to fix races, tsleep race fixes, +more

* Refactor the signal code to properly hold the lp->lwp_token.  In
  particular the ksignal() and lwp_signotify() paths.

* The tsleep() path must also hold lp->lwp_token to properly handle
  lp->lwp_stat states and interlocks.

* Refactor the timeout code in tsleep() to ensure that endtsleep() is only
  called from the proper context, and fix races between endtsleep() and
  lwkt_switch().

* Rename proc->p_flag to proc->p_flags

* Rename lwp->lwp_flag to lwp->lwp_flags

* Add lwp->lwp_mpflags and move flags which require atomic ops (are adjusted
  when not the current thread) to the new field.

* Add td->td_mpflags and move flags which require atomic ops (are adjusted
  when not the current thread) to the new field.

* Add some freeze testing code to the x86-64 trap code (default disabled).
74 files changed:
lib/libkvm/kvm_proc.c
sys/ddb/db_ps.c
sys/dev/raid/vinum/.gdbinit.kernel
sys/dev/raid/vinum/vinumdaemon.c
sys/emulation/43bsd/43bsd_signal.c
sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c
sys/emulation/linux/i386/linux_ptrace.c
sys/emulation/linux/i386/linux_sysvec.c
sys/emulation/linux/linux_file.c
sys/emulation/ndis/ntoskrnl_var.h
sys/kern/init_main.c
sys/kern/kern_acct.c
sys/kern/kern_checkpoint.c
sys/kern/kern_clock.c
sys/kern/kern_descrip.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_intr.c
sys/kern/kern_jail.c
sys/kern/kern_kinfo.c
sys/kern/kern_kthread.c
sys/kern/kern_ktrace.c
sys/kern/kern_proc.c
sys/kern/kern_prot.c
sys/kern/kern_resource.c
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/kern/kern_threads.c
sys/kern/kern_time.c
sys/kern/kern_timeout.c
sys/kern/kern_upcall.c
sys/kern/lwkt_thread.c
sys/kern/subr_prf.c
sys/kern/subr_prof.c
sys/kern/subr_taskqueue.c
sys/kern/sys_generic.c
sys/kern/sys_process.c
sys/kern/tty.c
sys/kern/tty_pty.c
sys/kern/tty_tty.c
sys/kern/usched_bsd4.c
sys/kern/usched_dummy.c
sys/kern/vfs_journal.c
sys/net/if.c
sys/net/netisr.c
sys/netproto/smb/smb_subr.c
sys/platform/pc32/i386/db_trace.c
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/trap.c
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/trap.c
sys/platform/vkernel/i386/cpu_regs.c
sys/platform/vkernel/i386/trap.c
sys/platform/vkernel64/x86_64/cpu_regs.c
sys/platform/vkernel64/x86_64/trap.c
sys/sys/proc.h
sys/sys/signal2.h
sys/sys/thread.h
sys/sys/tty.h
sys/vfs/procfs/procfs.h
sys/vfs/procfs/procfs_ctl.c
sys/vfs/procfs/procfs_dbregs.c
sys/vfs/procfs/procfs_fpregs.c
sys/vfs/procfs/procfs_map.c
sys/vfs/procfs/procfs_mem.c
sys/vfs/procfs/procfs_regs.c
sys/vfs/procfs/procfs_status.c
sys/vfs/procfs/procfs_type.c
sys/vfs/procfs/procfs_vnops.c
sys/vm/vm_fault.c
sys/vm/vm_glue.c
sys/vm/vm_meter.c
sys/vm/vm_pageout.c