Messages in this thread | | | Date | Sun, 16 May 2010 03:33:14 +0000 | From | "Daniel K." <> | Subject | Re: [PATCH 10/10] tty: implement BTM as mutex instead of BKL |
| |
Arnd Bergmann wrote: > diff --git a/drivers/char/tty_mutex.c b/drivers/char/tty_mutex.c > new file mode 100644 > index 0000000..f66dfdf > --- /dev/null > +++ b/drivers/char/tty_mutex.c > @@ -0,0 +1,47 @@ > +/* > + * drivers/char/tty_lock.c > + */ > +#include <linux/tty.h> > +#include <linux/module.h> > +#include <linux/kallsyms.h> > +#include <linux/semaphore.h> > +#include <linux/sched.h> > + > +/* > + * The 'big tty semaphore'
Referred to as Big TTY Mutex or BTM elsewhere.
> + * This mutex is taken and released by tty_lock() and tty_unlock(), > + * replacing the older big kernel mutex.
big kernel lock, or BKL?
> + * It can no longer be taken recursively, and does not get > + * released implicitly while sleeping. > + * > + * Don't use in new code. > + */ > +static DEFINE_MUTEX(big_tty_mutex); > +struct task_struct *__big_tty_mutex_owner; > +EXPORT_SYMBOL_GPL(__big_tty_mutex_owner);
> +config TTY_MUTEX > + bool "Use a mutex instead of BKL for TTY locking" > + depends on EXPERIMENTAL && SMP > + help > + The TTY subsystem traditionally depends on the big kernel lock > + for serialization. Saying Y here replaces the BKL with the Big > + TTY Mutex (BTM). > + Building a kernel without the BKL is only possible with TTY_MUTEX > + enabled. > +
Daniel K.
| |