mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
![Peter Hurley](/assets/img/avatar_default.png)
The semantics of a rw semaphore are almost ideally suited for tty line discipline lifetime management; multiple active threads obtain "references" (read locks) while performing i/o to prevent the loss or change of the current line discipline (write lock). Unfortunately, the existing rw_semaphore is ill-suited in other ways; 1) TIOCSETD ioctl (change line discipline) expects to return an error if the line discipline cannot be exclusively locked within 5 secs. Lock wait timeouts are not supported by rwsem. 2) A tty hangup is expected to halt and scrap pending i/o, so exclusive locking must be prioritized. Writer priority is not supported by rwsem. Add ld_semaphore which implements these requirements in a semantically similar way to rw_semaphore. Writer priority is handled by separate wait lists for readers and writers. Pending write waits are priortized before existing read waits and prevent further read locks. Wait timeouts are trivially added, but obviously change the lock semantics as lock attempts can fail (but only due to timeout). This implementation incorporates the write-lock stealing work of Michel Lespinasse <walken@google.com>. Cc: Michel Lespinasse <walken@google.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33 lines
1.1 KiB
Makefile
33 lines
1.1 KiB
Makefile
obj-$(CONFIG_TTY) += tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o \
|
|
tty_buffer.o tty_port.o tty_mutex.o tty_ldsem.o
|
|
obj-$(CONFIG_LEGACY_PTYS) += pty.o
|
|
obj-$(CONFIG_UNIX98_PTYS) += pty.o
|
|
obj-$(CONFIG_AUDIT) += tty_audit.o
|
|
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
|
|
obj-$(CONFIG_N_HDLC) += n_hdlc.o
|
|
obj-$(CONFIG_N_GSM) += n_gsm.o
|
|
obj-$(CONFIG_TRACE_ROUTER) += n_tracerouter.o
|
|
obj-$(CONFIG_TRACE_SINK) += n_tracesink.o
|
|
obj-$(CONFIG_R3964) += n_r3964.o
|
|
|
|
obj-y += vt/
|
|
obj-$(CONFIG_HVC_DRIVER) += hvc/
|
|
obj-y += serial/
|
|
|
|
# tty drivers
|
|
obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
|
|
obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o
|
|
obj-$(CONFIG_CYCLADES) += cyclades.o
|
|
obj-$(CONFIG_ISI) += isicom.o
|
|
obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
|
|
obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
|
|
obj-$(CONFIG_NOZOMI) += nozomi.o
|
|
obj-$(CONFIG_ROCKETPORT) += rocket.o
|
|
obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
|
|
obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o
|
|
obj-$(CONFIG_SYNCLINK) += synclink.o
|
|
obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o
|
|
obj-$(CONFIG_GOLDFISH_TTY) += goldfish.o
|
|
obj-$(CONFIG_DA_TTY) += metag_da.o
|
|
|
|
obj-y += ipwireless/
|