freebsd-skq/sys/kern
Doug Rabson dfdcada31e Add the new kernel-mode NFS Lock Manager. To use it instead of the
user-mode lock manager, build a kernel with the NFSLOCKD option and
add '-k' to 'rpc_lockd_flags' in rc.conf.

Highlights include:

* Thread-safe kernel RPC client - many threads can use the same RPC
  client handle safely with replies being de-multiplexed at the socket
  upcall (typically driven directly by the NIC interrupt) and handed
  off to whichever thread matches the reply. For UDP sockets, many RPC
  clients can share the same socket. This allows the use of a single
  privileged UDP port number to talk to an arbitrary number of remote
  hosts.

* Single-threaded kernel RPC server. Adding support for multi-threaded
  server would be relatively straightforward and would follow
  approximately the Solaris KPI. A single thread should be sufficient
  for the NLM since it should rarely block in normal operation.

* Kernel mode NLM server supporting cancel requests and granted
  callbacks. I've tested the NLM server reasonably extensively - it
  passes both my own tests and the NFS Connectathon locking tests
  running on Solaris, Mac OS X and Ubuntu Linux.

* Userland NLM client supported. While the NLM server doesn't have
  support for the local NFS client's locking needs, it does have to
  field async replies and granted callbacks from remote NLMs that the
  local client has contacted. We relay these replies to the userland
  rpc.lockd over a local domain RPC socket.

* Robust deadlock detection for the local lock manager. In particular
  it will detect deadlocks caused by a lock request that covers more
  than one blocking request. As required by the NLM protocol, all
  deadlock detection happens synchronously - a user is guaranteed that
  if a lock request isn't rejected immediately, the lock will
  eventually be granted. The old system allowed for a 'deferred
  deadlock' condition where a blocked lock request could wake up and
  find that some other deadlock-causing lock owner had beaten them to
  the lock.

* Since both local and remote locks are managed by the same kernel
  locking code, local and remote processes can safely use file locks
  for mutual exclusion. Local processes have no fairness advantage
  compared to remote processes when contending to lock a region that
  has just been unlocked - the local lock manager enforces a strict
  first-come first-served model for both local and remote lockers.

Sponsored by:	Isilon Systems
PR:		95247 107555 115524 116679
MFC after:	2 weeks
2008-03-26 15:23:12 +00:00
..
bus_if.m Implement a BUS_BIND_INTR() method in the bus interface to bind an IRQ 2008-03-20 21:24:32 +00:00
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh refactor code so it can run in a chroot without having to have /dev/mounted 2008-01-18 17:02:14 +00:00
imgact_aout.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
imgact_elf32.c
imgact_elf64.c
imgact_elf.c Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
imgact_gzip.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
imgact_shell.c
inflate.c
init_main.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
init_sysent.c Regen after changing prototypes of cpuset_{get,set}affinity(). 2008-03-25 09:14:17 +00:00
kern_acct.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
kern_alq.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_clock.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_condvar.c - Pass the priority argument from *sleep() into sleepq and down into 2008-03-12 06:31:06 +00:00
kern_conf.c Fix two races in the handling of the d_gianttrick for the D_NEEDGIANT 2008-03-17 13:17:10 +00:00
kern_context.c Further system call comment cleanup: 2007-03-05 13:10:58 +00:00
kern_cpu.c Remove duplicate cpufreq levels, i.e. ones that are within 25 Mhz of each 2008-01-16 01:05:21 +00:00
kern_cpuset.c Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t. 2008-03-25 09:11:53 +00:00
kern_descrip.c Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
kern_environment.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
kern_event.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_exec.c Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
kern_exit.c In abort2(2): Accept a NULL arg pointer if nargs == 0 2008-03-22 16:32:52 +00:00
kern_fork.c Fix the leak of the vmspace on the fork when the process limits 2008-03-20 15:24:49 +00:00
kern_idle.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_intr.c Simplify the interrupt code a bit: 2008-03-17 22:42:01 +00:00
kern_jail.c Replace the last susers calls in netinet6/ with privilege checks. 2008-01-24 08:25:59 +00:00
kern_kthread.c - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from 2008-03-19 06:19:01 +00:00
kern_ktr.c
kern_ktrace.c This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload 2008-02-23 01:01:49 +00:00
kern_linker.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_lock.c - Handle buffer lock waiters count directly in the buffer cache instead 2008-03-01 19:47:50 +00:00
kern_lockf.c Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
kern_malloc.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_mbuf.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_mib.c Make sysctl_kern_arnd return a random buffer instead of a random long, 2008-02-17 16:44:48 +00:00
kern_module.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_mtxpool.c Universally adopt most conventional spelling of acquire. 2007-05-27 20:50:23 +00:00
kern_mutex.c Add KASSERT()'s to catch attempts to recurse on spin mutexes that aren't 2008-02-13 23:39:05 +00:00
kern_ntptime.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_physio.c
kern_pmc.c Kernel and hwpmc(4) support for callchain capture. 2007-12-07 08:20:17 +00:00
kern_poll.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_priv.c Add __FBSDID() tag. 2008-03-07 15:27:08 +00:00
kern_proc.c - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from 2008-03-19 06:19:01 +00:00
kern_prot.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
kern_resource.c Remove extra uihold() call that accidentally sneak in during perforce 2008-03-19 07:52:07 +00:00
kern_rmlock.c Expand lock class with the "virtual" function lc_assert which will offer 2007-11-18 14:43:53 +00:00
kern_rwlock.c - In rw_wunlock_hard prefer to wakeup writers if there are both readers 2008-02-07 06:16:54 +00:00
kern_sema.c
kern_shutdown.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_sig.c - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs 2008-03-21 08:23:25 +00:00
kern_subr.c Commit 14/14 of sched_lock decomposition. 2007-06-05 00:00:57 +00:00
kern_switch.c - Restore runq to manipulating threads directly by putting runq links and 2008-03-20 05:51:16 +00:00
kern_sx.c - Pass the priority argument from *sleep() into sleepq and down into 2008-03-12 06:31:06 +00:00
kern_synch.c Consistently use ANSI C declarationsfor all functions in kern_synch.c. 2008-03-16 18:59:21 +00:00
kern_syscalls.c
kern_sysctl.c Add sysctl_rename_oid() to support device_set_unit() usage. Otherwise, 2007-11-30 21:29:08 +00:00
kern_tc.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
kern_thr.c Remove commented out code, thread suspension is done in thread library. 2008-03-23 02:03:06 +00:00
kern_thread.c - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs 2008-03-21 08:23:25 +00:00
kern_time.c Make sure reading td_runtime in critical section since thread may be 2008-01-18 13:00:28 +00:00
kern_timeout.c Fix a race where timeout/untimeout could cause crashes for Giant locked 2008-03-22 07:29:45 +00:00
kern_umtx.c Check NULL pointer. 2007-12-17 08:09:37 +00:00
kern_uuid.c Correct typo. 2007-04-23 12:53:00 +00:00
kern_xxx.c Further system call comment cleanup: 2007-03-05 13:10:58 +00:00
ksched.c Commit 14/14 of sched_lock decomposition. 2007-06-05 00:00:57 +00:00
link_elf_obj.c Fix panic on e.g. "kldload /dev/null". 2008-03-15 17:40:18 +00:00
link_elf.c Fix panic on e.g. "kldload /dev/null". 2008-03-15 17:40:18 +00:00
linker_if.m Add a function to list symbols in a file and their values at the 2007-11-18 00:23:31 +00:00
Make.tags.inc Remove netkey directory from cscope/TAGs generation and replace 2007-07-05 08:55:14 +00:00
Makefile style.Makefile(5) 2007-12-14 21:30:51 +00:00
makesyscalls.sh Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t. 2008-03-25 09:11:53 +00:00
md4c.c
md5c.c
p1003_1b.c Remove kernel support for M:N threading. 2008-03-12 10:12:01 +00:00
posix4_mib.c Fix mispatch of includes list; allows my kernel to build successfully. 2006-11-12 03:34:03 +00:00
sched_4bsd.c - Restore runq to manipulating threads directly by putting runq links and 2008-03-20 05:51:16 +00:00
sched_ule.c - Restore runq to manipulating threads directly by putting runq links and 2008-03-20 05:51:16 +00:00
serdev_if.m
subr_acl_posix1e.c Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in 2007-06-12 00:12:01 +00:00
subr_autoconf.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_blist.c
subr_bus.c Implement a BUS_BIND_INTR() method in the bus interface to bind an IRQ 2008-03-20 21:24:32 +00:00
subr_clist.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_clock.c If clock_ct_to_ts fails to convert time time from the real time clock, 2007-07-23 09:42:32 +00:00
subr_devstat.c
subr_disk.c Add a new I/O request - BIO_FLUSH, which basically tells providers below to 2006-10-31 21:11:21 +00:00
subr_eventhandler.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_fattime.c Better naming of fattime conversion functions, they do convert to timespec 2006-10-24 10:27:23 +00:00
subr_firmware.c Cleanup and document the implementation of firmware(9) based on 2007-02-15 17:21:31 +00:00
subr_hints.c
subr_kdb.c Add a new 'why' argument to kdb_enter(), and a set of constants to use 2007-12-25 17:52:02 +00:00
subr_kobj.c
subr_lock.c Really, no explicit checks against against lock_class_* object should be 2008-02-06 00:04:09 +00:00
subr_log.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_mbpool.c Add parens around *free in *free++ in mbp_count() so that mbp_count() 2007-05-27 17:38:36 +00:00
subr_mchain.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
subr_module.c
subr_msgbuf.c
subr_param.c Export maxswzone, maxbcache, maxtsiz, dfldsiz, maxdsiz, dflssiz, maxssiz, 2007-10-16 10:40:53 +00:00
subr_pcpu.c generally we are interested in what thread did something as 2007-11-14 06:21:24 +00:00
subr_power.c
subr_prf.c Instead of doing comparisons using the pcpu area to see if 2007-03-08 06:44:34 +00:00
subr_prof.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_rman.c Complete removal of restriction about overlaps to rman_manage_region: 2007-04-28 07:37:49 +00:00
subr_rtc.c Use utc_offset() where applicable, and hide the internals of it 2006-10-02 18:23:37 +00:00
subr_sbuf.c
subr_scanf.c
subr_sleepqueue.c - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs 2008-03-21 08:23:25 +00:00
subr_smp.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
subr_stack.c When a symbol name can't be resolved, return "??" as the name, rather 2007-12-03 14:44:35 +00:00
subr_taskqueue.c Implement taskqueue_block() and taskqueue_unblock(). These functions allow 2008-03-25 22:38:45 +00:00
subr_trap.c - Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs 2008-03-21 08:23:25 +00:00
subr_turnstile.c - Add THREAD_LOCKPTR_ASSERT() to assert that the thread's lock points at 2008-02-07 06:55:38 +00:00
subr_unit.c Since cdev mutex is after system map mutex in global lock order, free() 2007-07-04 06:56:58 +00:00
subr_witness.c - There is no more "uidinfo struct" mutex. 2008-03-17 11:48:40 +00:00
sys_generic.c - Remove stale comment. 2008-03-19 07:33:16 +00:00
sys_pipe.c Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
sys_process.c - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from 2008-03-19 06:19:01 +00:00
sys_socket.c Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
syscalls.c Regen after changing prototypes of cpuset_{get,set}affinity(). 2008-03-25 09:14:17 +00:00
syscalls.master Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00
systrace_args.c Regen after changing prototypes of cpuset_{get,set}affinity(). 2008-03-25 09:14:17 +00:00
sysv_ipc.c Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in 2007-06-12 00:12:01 +00:00
sysv_msg.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
sysv_sem.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
sysv_shm.c Make sure we restrict Linux only IPC calls from being executed 2008-02-12 20:55:03 +00:00
tty_compat.c
tty_conf.c
tty_cons.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
tty_pts.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
tty_pty.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
tty_subr.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
tty_tty.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
tty.c - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from 2008-03-19 06:19:01 +00:00
uipc_accf.c
uipc_cow.c Give MEXTADD() another argument to make both void pointers to the 2008-02-01 19:36:27 +00:00
uipc_debug.c Add missing sb_sndptr* fields to db_print_sockbuf(). 2008-01-03 15:19:31 +00:00
uipc_domain.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
uipc_mbuf2.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
uipc_mbuf.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
uipc_mqueue.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
uipc_sem.c Free MAC label on a POSIX semaphore when the semaphore is freed. 2008-01-07 22:03:19 +00:00
uipc_shm.c Change shm_dotruncate() so that it correctly handles cached pages that span 2008-02-07 05:55:16 +00:00
uipc_sockbuf.c Further clean up sorflush: 2008-02-04 12:25:13 +00:00
uipc_socket.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
uipc_syscalls.c Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT. 2008-03-25 09:39:02 +00:00
uipc_usrreq.c Move unlock of global UNIX domain socket lock slightly lower in 2008-01-18 19:16:03 +00:00
vfs_acl.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
vfs_aio.c Use FEATURE() macro to advertise aio availability. 2008-02-01 11:59:14 +00:00
vfs_bio.c - Complete part of the unfinished bufobj work by consistently using 2008-03-22 09:15:16 +00:00
vfs_cache.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
vfs_cluster.c - Complete part of the unfinished bufobj work by consistently using 2008-03-22 09:15:16 +00:00
vfs_default.c - Complete part of the unfinished bufobj work by consistently using 2008-03-22 09:15:16 +00:00
vfs_export.c Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method. 2007-02-15 22:08:35 +00:00
vfs_extattr.c VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
vfs_hash.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
vfs_init.c Remove VFS_VPTOFH entirely. API is already broken and it is good time to 2007-02-16 17:32:41 +00:00
vfs_lookup.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
vfs_mount.c Yield the cpu in the kernel while iterating the list of the 2008-03-23 13:45:24 +00:00
vfs_subr.c - Greatly simplify vget() by removing the guarantee that any new 2008-03-24 04:22:58 +00:00
vfs_syscalls.c This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload 2008-02-23 01:01:49 +00:00
vfs_vnops.c - Don't acquire the vnode interlock in _vn_lock() unless no lock type 2008-03-24 04:17:35 +00:00
vnode_if.src Add the new kernel-mode NFS Lock Manager. To use it instead of the 2008-03-26 15:23:12 +00:00