freebsd-skq/sys/kern
ed cc3116a938 Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

  The old TTY layer has a driver model that is not abstract enough to
  make it friendly to use. A good example is the output path, where the
  device drivers directly access the output buffers. This means that an
  in-kernel PPP implementation must always convert network buffers into
  TTY buffers.

  If a PPP implementation would be built on top of the new TTY layer
  (still needs a hooks layer, though), it would allow the PPP
  implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

  With the old TTY layer, it isn't entirely safe to destroy TTY's from
  the system. This implementation has a two-step destructing design,
  where the driver first abandons the TTY. After all threads have left
  the TTY, the TTY layer calls a routine in the driver, which can be
  used to free resources (unit numbers, etc).

  The pts(4) driver also implements this feature, which means
  posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

  One of the major improvements is the per-TTY mutex, which is expected
  to improve scalability when compared to the old Giant locking.
  Another change is the unbuffered copying to userspace, which is both
  used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from:		//depot/projects/mpsafetty/...
Approved by:		philip (ex-mentor)
Discussed:		on the lists, at BSDCan, at the DevSummit
Sponsored by:		Snow B.V., the Netherlands
dcons(4) fixed by:	kan
2008-08-20 08:31:58 +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 Go back to using the process command name (p_comm) for the file name and 2008-05-15 03:07:34 +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 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
init_sysent.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
kern_acct.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
kern_alq.c Use msleep_spin() instead of unlock/tsleep/lock. This was 2008-07-02 20:44:33 +00:00
kern_clock.c Implement per-cpu callout threads, wheels, and locks. 2008-04-02 11:20:30 +00:00
kern_condvar.c Permit Giant to be passed as the explicit interlock either to 2008-08-07 21:00:13 +00:00
kern_conf.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
kern_context.c Further system call comment cleanup: 2007-03-05 13:10:58 +00:00
kern_cpu.c Fix a few edge cases with error handling in cpufreq(4)'s CPUFREQ_GET() 2008-05-05 19:13:52 +00:00
kern_cpuset.c Add a `show cpusets' DDB command to print numbered root and 2008-07-07 21:32:02 +00:00
kern_ctf.c Add the CTF source file which gets shared with link_elf.c and link_elf_obj.c. 2008-05-23 03:04:27 +00:00
kern_descrip.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
kern_dtrace.c Remove code that isn't required. It actually breaks the case where KDTRACE_HOOKS 2008-06-16 04:44:29 +00:00
kern_environment.c Implement the following macros for completeness: 2008-07-21 15:05:25 +00:00
kern_event.c The kqueue_register() function assumes that it is called from the top of 2008-07-07 09:30:11 +00:00
kern_exec.c Reduce the scope of the vnode lock such that it does not cover 2008-08-12 21:27:48 +00:00
kern_exit.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
kern_fork.c Do the pargs_hold() on the copy of the pointer to the p_args of the 2008-07-23 08:45:25 +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 revert change from local tree 2008-07-18 07:07:57 +00:00
kern_jail.c Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
kern_kthread.c Kill a dead variable 2008-08-03 21:07:19 +00:00
kern_ktr.c Remove slightly oddly placed suser() call from the KTR/ALQ setup sysctl: 2006-09-09 16:09:01 +00:00
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 Add the ctf_get function and update the args to linker_file_function_listall. 2008-05-23 07:08:59 +00:00
kern_lock.c If a thread that is swapped out is made runnable, then the setrunnable() 2008-08-05 20:02:31 +00:00
kern_lockf.c Re-implement the client side of rpc.lockd in the kernel. This implementation 2008-06-26 10:21:54 +00:00
kern_malloc.c Enable the creation of a kmem map larger than 4GB. 2008-07-05 19:34:33 +00:00
kern_mbuf.c Reintroduce UMA_SLAB_KMAP; however, change its spelling to 2008-04-04 18:41:12 +00:00
kern_mib.c Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +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 Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
kern_priv.c Add __FBSDID() tag. 2008-03-07 15:27:08 +00:00
kern_proc.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +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 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +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 Improve a comment which, in the actual CVS stock, doesn't completely 2008-05-27 00:27:50 +00:00
kern_sdt.c Add kernel support for the Statically Defined Trace provider. 2008-05-18 19:32:36 +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 If a thread that is swapped out is made runnable, then the setrunnable() 2008-08-05 20:02:31 +00:00
kern_subr.c - Make SCHED_STATS more generic by adding a wrapper to create the 2008-04-17 04:20:10 +00:00
kern_switch.c fix typo in runz_fuzz 2008-05-12 06:42:06 +00:00
kern_sx.c If a thread that is swapped out is made runnable, then the setrunnable() 2008-08-05 20:02:31 +00:00
kern_synch.c Permit Giant to be passed as the explicit interlock either to 2008-08-07 21:00:13 +00:00
kern_syscalls.c Make system call modules a bit more robust: 2006-08-01 16:32:20 +00:00
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 Fix compiling problem. 2008-04-29 05:48:05 +00:00
kern_thread.c Introduce some WITNESS improvements: 2008-08-13 18:24:22 +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 add callout_schedule; besides being useful it also improves 2008-08-02 17:42:38 +00:00
kern_umtx.c Add two commands to _umtx_op system call to allow a simple mutex to be 2008-06-24 07:32:12 +00:00
kern_uuid.c Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
kern_xxx.c Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
ksched.c Commit 14/14 of sched_lock decomposition. 2007-06-05 00:00:57 +00:00
link_elf_obj.c Calling linker_load_dependencies() while holding the module' 2008-08-03 13:33:45 +00:00
link_elf.c Calling linker_load_dependencies() while holding the module' 2008-08-03 13:33:45 +00:00
linker_if.m Add the ctf_get method. 2008-05-23 04:06:49 +00:00
Make.tags.inc Remove netatm from HEAD as it is not MPSAFE and relies on the now removed 2008-05-25 22:11:40 +00:00
Makefile style.Makefile(5) 2007-12-14 21:30:51 +00:00
makesyscalls.sh Generate another function for the DTrace syscall provider to specify 2008-03-27 01:53:44 +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 When choosing a CPU for a thread in a cpuset, prefer the last CPU that the 2008-07-28 20:39:21 +00:00
sched_ule.c - Check whether we've recorded this tick in ts_ticks on another cpu in 2008-07-19 05:13:47 +00:00
serdev_if.m
stack_protector.c Fix a chicken-and-egg problem: this files implements SSP support, 2008-06-26 07:52:45 +00:00
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 If run_interrupt_driven_config_hooks() waits 360 seconds and INVARIANTS 2008-07-21 20:50:49 +00:00
subr_blist.c add malloc flag to blist so that it can be used in ithread context 2008-05-05 19:48:54 +00:00
subr_bus.c Split out the probing magic of device_probe_and_attach into 2008-06-20 16:58:15 +00:00
subr_clist.c Don't make subr_clist.c depend on the TTY layer. 2008-07-30 12:32:42 +00:00
subr_clock.c Now that all platforms use genclock, shuffle things around slightly 2008-04-22 19:38:30 +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 Do image loading in a context known to have a root directory: 2008-04-09 19:07:48 +00:00
subr_hints.c
subr_kdb.c Expand kdb_alt_break a little, most commonly used with the option 2008-05-04 23:29:38 +00:00
subr_kobj.c
subr_lock.c - track maximum wait time 2008-07-27 21:45:20 +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 Correct an error in the comments for init_param3(). 2008-07-04 19:36:58 +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 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +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 Now that all platforms use genclock, shuffle things around slightly 2008-04-22 19:38:30 +00:00
subr_sbuf.c Switch to simplified BSD license (with phk's approval), plus whitespace 2008-08-09 10:26:21 +00:00
subr_scanf.c
subr_sleepqueue.c If a thread that is swapped out is made runnable, then the setrunnable() 2008-08-05 20:02:31 +00:00
subr_smp.c Allow a rendezvous with just a specified CPU too. 2008-05-23 04:05:26 +00:00
subr_stack.c Staticize M_STACK. 2008-07-13 17:15:05 +00:00
subr_taskqueue.c revert local change 2008-07-18 07:10:33 +00:00
subr_trap.c - Make SCHED_STATS more generic by adding a wrapper to create the 2008-04-17 04:20:10 +00:00
subr_turnstile.c - Make SCHED_STATS more generic by adding a wrapper to create the 2008-04-17 04:20:10 +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 Introduce some WITNESS improvements: 2008-08-13 18:24:22 +00:00
sys_generic.c - Remove stale comment. 2008-03-19 07:33:16 +00:00
sys_pipe.c Another problem caused by the knlist_cleardel() potentially dropping 2008-05-23 11:14:03 +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 Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
syscalls.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
syscalls.master Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
systrace_args.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +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 Renew semaphore's pointer after wakeup since during msleep 2008-06-19 18:08:42 +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 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_cons.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_info.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_inq.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_outq.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_pts.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_pty.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty_tty.c Remove unneeded Giant locking of /dev/tty. 2008-06-03 12:38:00 +00:00
tty_ttydisc.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
tty.c Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +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 Change a variable name to not shadow a global 2008-07-03 08:35:59 +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 Attempt to make the print types more friendly to other architectures. 2008-04-30 20:00:30 +00:00
uipc_mqueue.c - Use vget() to lock the vnode rather than refing without a lock and 2008-03-29 23:30:40 +00:00
uipc_sem.c Rework the lifetime management of the kernel implementation of POSIX 2008-06-27 05:39:04 +00:00
uipc_shm.c Rework the lifetime management of the kernel implementation of POSIX 2008-06-27 05:39:04 +00:00
uipc_sockbuf.c Update the kernel to count the number of mbufs and clusters 2008-05-15 20:18:44 +00:00
uipc_socket.c Add accessor functions for socket fields. 2008-07-21 00:49:34 +00:00
uipc_syscalls.c When sendto(2) is called with an explicit destination address 2008-05-22 07:18:54 +00:00
uipc_usrreq.c Fill in a few sysctl descriptions. 2008-07-26 00:55:35 +00:00
vfs_acl.c Add the support for the AT_FDCWD and fd-relative name lookups to the 2008-03-31 12:01:21 +00:00
vfs_aio.c Use minimum of max_aio_procs and target_aio_procs when spawning new 2008-06-21 11:34:34 +00:00
vfs_bio.c In brelse, put the B_NEEDSGIANT buffer on the QUEUE_DIRTY_GIANT queue, 2008-08-19 11:31:49 +00:00
vfs_cache.c Prevent crashes due to unlocked access to hash buckets in two sysctls. 2008-08-16 21:48:10 +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 Move the head of byte-level advisory lock list from the 2008-04-16 11:33:32 +00:00
vfs_export.c Provide the mutual exclusion between the nfs export list modifications 2008-06-09 10:31:38 +00:00
vfs_extattr.c Add the support for the AT_FDCWD and fd-relative name lookups to the 2008-03-31 12:01:21 +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 Implement the linux syscalls 2008-04-08 09:45:49 +00:00
vfs_mount.c Revert r181345. 2008-08-10 12:15:36 +00:00
vfs_subr.c Remove the use of lbolt from the VFS syncer. 2008-07-30 12:39:18 +00:00
vfs_syscalls.c If S_IFIFO is passed to mknod(2), invoke kern_mkfifoat(9) to create a 2008-06-22 21:51:32 +00:00
vfs_vnops.c Remove broken code to replace st_mode value with ACCESSPERMS when 2008-08-03 15:44:56 +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