DragonFlyBSD/src 2efb75fsys/bus/isa vga_isa.c, sys/bus/u4b/serial usb_serial.c

kernel - Refactor tty_token, fix SMP performance issues

* Remove most uses of tty_token in favor of per-tty tp->t_token.
  This is particularly important for removing bottlenecks related to PTYs,
  which are used all over the place.  tty_token remains in a few places
  managing overall registration and global list manipulation.

* tty structures are now required to be persistent.  Implement a sepearate
  ttyinit() function.  Continue to allow ttyregister() and ttyunregister()
  calls, but these no longer presume destruction of the structure.

* Refactor ttymalloc() to take a **tty pointer and interlock allocations.
  Allocations are intended to be one-time.  ttymalloc() only requires the
  tty_token for initial allocations.

* Remove all critical section use that was combined with tty_token and
  tp->t_token.  Leave only the tokens.  The critical sections were
  hold-overs going all the way back to pre-SMP days.

* syscons now gets its own token, vga_token.  The ISA VGA code and
  the framebuffer code also now use this token instead of tty_token.

* The keyboard subsystem now uses kbd_token instead of tty_token.

* A few remaining serial-like devices (snp, nmdm) also get their own
  tokens, as well as use the now required tp->t_token.

* Remove use of tty_token in the session management code.  This fixes
  a niggling performance path since sessions almost universally go
  hand-in-hand with fork/exec/exit sequences.  Instead we use the
  already-existing per-hash session token.
DeltaFile
+190-214sys/kern/tty.c
+193-170sys/dev/misc/syscons/syscons.c
+215-127sys/kern/tty_pty.c
+119-164sys/dev/misc/kbd/kbd.c
+79-80sys/dev/misc/syscons/scvidctl.c
+70-61sys/dev/misc/snp/snp.c
+48-71sys/bus/u4b/serial/usb_serial.c
+70-48sys/dev/misc/nmdm/nmdm.c
+34-79sys/kern/tty_subr.c
+35-66sys/netgraph7/tty/ng_tty.c
+39-47sys/netgraph/tty/ng_tty.c
+29-50sys/dev/misc/dcons/dcons_os.c
+33-42sys/net/sl/if_sl.c
+18-18sys/dev/video/fb/fb.c
+18-18sys/netgraph7/bluetooth/drivers/h4/ng_h4.c
+19-17sys/platform/vkernel64/platform/console.c
+12-12sys/dev/video/fb/bmp/splash_bmp.c
+12-12sys/dev/misc/atkbdc_layer/atkbdc_isa.c
+9-9sys/dev/video/fb/vga.c
+8-8sys/dev/video/fb/fbreg.h
+4-4sys/dev/misc/atkbd/atkbd_isa.c
+4-4sys/dev/misc/syscons/scvgarndr.c
+6-1sys/sys/tty.h
+2-4sys/kern/kern_proc.c
+2-2sys/bus/isa/vga_isa.c
+2-1sys/dev/serial/sio/sio.c
+2-0sys/kern/tty_cons.c
+2-0sys/sys/proc.h
+2-0sys/sys/thread.h
+2-0sys/kern/lwkt_token.c
+1,278-1,32930 files

UnifiedSplitRaw