public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/9] BKL conversion in TTY drivers
@ 2010-03-30 20:56 Arnd Bergmann
  2010-03-30 20:56 ` [RFC 1/9] tty: replace BKL with a new tty_lock Arnd Bergmann
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Arnd Bergmann @ 2010-03-30 20:56 UTC (permalink / raw)
  To: LKML
  Cc: Alan Cox, Greg KH, Frederic Weisbecker, Thomas Gleixner,
	Andrew Morton, John Kacur, Al Viro, Ingo Molnar, Arnd Bergmann

This is one of the tricker bits in the BKL removal series,
so let's discuss it here. In order to build a kernel without
the BKL, it's obviously necessary to do something about
the TTY code. This series introduces a new Big TTY Mutex
that is based on the earlier implementation of the
Big Kernel Semaphore, but comes with a number of changes:

 - based on the mutex code instead of a semaphore,
   so we can use all the mutex debugging.
 - no autorelease on sleep, which is what most of the
   series is about.
 - limited to one subsystem only.
 - ability to annotate nested locking so we can eventually
   turn it into a non-recursive mutex, once all the
   recursive users stay around.

The first eight patches convert all the code using the BKL
in the TTY layer and related drivers to the new interface,
while the final patch adds the real mutex implementation
as an experimental configuration option.

When that option is disabled, the behaviour should be
basically unchanged regarding serialization against
other subsystems using the BKL.

Together with the patches removing the BKL from block,
procfs, init, usb and VFS, it then becomes realistic to
build a kernel that does not contain the BKL at all,
while disabling all code that still uses it.
This means we are still safe, because there is no code
left that the new BTM fails to serialize with.

This smaller series is taken from my bkl-removal tree,
ported to 2.6.34-rc3 and with the last patch changed to
make the new implementation optional.

	Arnd 
---

Arnd Bergmann (9):
  tty: replace BKL with a new tty_lock
  tty: make atomic_write_lock release tty_lock
  tty: make tty_port->mutex nest under tty_lock
  tty: make termios mutex nest under tty_lock
  tty: make ldisc_mutex nest under tty_lock
  tty: never hold tty_lock() while getting tty_mutex
  ppp: use big tty mutex
  tty: release tty lock when blocking
  tty: implement BTM as mutex instead of BKL

 drivers/char/Makefile           |    1 +
 drivers/char/amiserial.c        |   16 ++--
 drivers/char/briq_panel.c       |    6 +-
 drivers/char/cyclades.c         |   20 ++--
 drivers/char/epca.c             |    4 +-
 drivers/char/isicom.c           |   10 +-
 drivers/char/istallion.c        |   20 ++--
 drivers/char/mxser.c            |   10 +-
 drivers/char/n_hdlc.c           |   16 ++--
 drivers/char/n_r3964.c          |   10 +-
 drivers/char/pty.c              |    8 +-
 drivers/char/riscom8.c          |    8 +-
 drivers/char/rocket.c           |    8 +-
 drivers/char/serial167.c        |    4 +-
 drivers/char/specialix.c        |   10 +-
 drivers/char/stallion.c         |   12 ++--
 drivers/char/sx.c               |   12 ++--
 drivers/char/synclink.c         |   10 ++-
 drivers/char/synclink_gt.c      |    8 +-
 drivers/char/synclinkmp.c       |   12 ++--
 drivers/char/tty_buffer.c       |    2 +-
 drivers/char/tty_io.c           |  123 ++++++++++++++-----------
 drivers/char/tty_ioctl.c        |   36 ++++----
 drivers/char/tty_ldisc.c        |   53 +++++++-----
 drivers/char/tty_port.c         |    6 +-
 drivers/char/vc_screen.c        |    4 +-
 drivers/char/vt.c               |    4 +-
 drivers/char/vt_ioctl.c         |   12 ++--
 drivers/isdn/i4l/isdn_common.c  |   20 ++--
 drivers/isdn/i4l/isdn_tty.c     |    8 +-
 drivers/net/irda/irtty-sir.c    |    5 +-
 drivers/net/ppp_generic.c       |   29 +++---
 drivers/serial/68360serial.c    |    4 +-
 drivers/serial/crisv10.c        |    8 +-
 drivers/serial/serial_core.c    |   42 +++++-----
 drivers/staging/strip/strip.c   |    2 +-
 drivers/usb/class/cdc-acm.c     |    2 +-
 drivers/usb/serial/usb-serial.c |   18 ++--
 drivers/video/console/vgacon.c  |    4 +-
 include/linux/init_task.h       |    1 +
 include/linux/sched.h           |    1 +
 include/linux/tty.h             |  188 +++++++++++++++++++++++++++++++++++++++
 kernel/fork.c                   |    1 +
 lib/Kconfig.debug               |   10 ++
 44 files changed, 510 insertions(+), 278 deletions(-)


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-04-01 19:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 20:56 [RFC 0/9] BKL conversion in TTY drivers Arnd Bergmann
2010-03-30 20:56 ` [RFC 1/9] tty: replace BKL with a new tty_lock Arnd Bergmann
2010-03-30 22:23   ` Frederic Weisbecker
2010-03-30 20:56 ` [RFC 2/9] tty: make atomic_write_lock release tty_lock Arnd Bergmann
2010-03-30 20:56 ` [RFC 3/9] tty: make tty_port->mutex nest under tty_lock Arnd Bergmann
2010-03-30 20:56 ` [RFC 4/9] tty: make termios mutex " Arnd Bergmann
2010-03-30 20:56 ` [RFC 5/9] tty: make ldisc_mutex " Arnd Bergmann
2010-03-30 20:56 ` [RFC 6/9] tty: never hold tty_lock() while getting tty_mutex Arnd Bergmann
2010-03-30 20:56 ` [RFC 7/9] ppp: use big tty mutex Arnd Bergmann
2010-03-31  4:37   ` Américo Wang
2010-03-31  7:39     ` Arnd Bergmann
2010-03-30 20:56 ` [RFC 8/9] tty: release tty lock when blocking Arnd Bergmann
2010-03-30 20:56 ` [RFC 9/9] tty: implement BTM as mutex instead of BKL Arnd Bergmann
2010-03-30 22:50   ` Frederic Weisbecker
2010-03-30 22:37 ` [RFC 0/9] BKL conversion in TTY drivers Alan Cox
2010-03-31  7:57   ` Arnd Bergmann
2010-03-31 10:02     ` Alan Cox
2010-04-01 12:51       ` Arnd Bergmann
2010-04-01 14:17         ` Alan Cox
2010-04-01 15:24           ` Greg KH
2010-04-01 19:10           ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox