On Mon, May 26, 2008 at 12:11 PM, Poul-Henning Kamp <phk_at_phk.freebsd.dk> wrote: > In message <20080526161608.GE64397_at_hoeg.nl>, Ed Schouten writes: > >>The new TTY layer should still support line disciplines, [...] > > Actually... I think it shouldn't. > > Line-disc's were introduced to interface weird-ass hardware like > digitizing tablets that had very high data rates, but very little > information (16 bit X, 16 bit Y and a couple of buttons, like modern > mice) which would cost inordinate amounts of CPU time to support > in userland on a VAX computer. > > If_slip.c happened in the kernel because there was no tun device, > people cranked the speed up all they could (Hands up: who has changed > the Xtal on a VAX serial port for faster SLIP ?) > > if_ppp happened because that was how if_slip did it. > > Today there is no longer a market for line disciplines and in > practice we have only one: the POSIX mandated "termios", which also > emulates the older "termio" ioctls. > > Anybody who cares to browse the three pages of text that RFC1055 > contains, will see that implementing SLIP in userland using tun(4) > and the code on the other three pages of RFC1055 is a trivial task > not even worthy of a SoC student. > > PPP over async is already much better handled in ppp(8) thanks > to Brians valiant effort back in the stoneage of the internet. > > We should summarily kill the concept of line disciplines as a > modular component and decide that TTYs can be used with termios(4) > or raw mode and leave it at that. Amen brother!! I'd like if_sl.c and if_ppp.c/ppp_tty.c to go away simply so that we don't have to keep the line discipline switch in its current form. Let the tty layer rewrite have a free hand at doing whatever locking strategy is most appropriate for ttys, without having to worry about line disciplines and the lock order problems that come with if_sl.c. There is a reason why we merged the splnet() and spltty() interrupt masks back when we had spl()s. The tty stack cross called into the network stack via if_sl, and vice versa. ppp_tty.c had a hack to create a swi (thread) to partly hack around this where it was most critical to limit blocking of interrupts. To make this work is likely going to need a full taskq or thread for both if_sl.c and ppp_tty.c. It just isn't worth it. Especially when we have a better option in userland for ppp, and slip is a few dozen lines of code around a if_tun select loop. I've written 75% of what it would take to do slip in userland at least two or three times already, over the last 10 years. It just isn't worth it. Let line disciplines die and give Ed a free hand to do ttys "right". Line disciplines were there so that we could push processing for things like serial mice into the kernel and reduce context switches. We've been doing that in userland for the last 14+ years. -- Peter Wemm - peter_at_wemm.org; peter_at_FreeBSD.org; peter_at_yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert SewellReceived on Tue May 27 2008 - 04:15:21 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:31 UTC