lkml.org 
[lkml]   [2010]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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.


    \
     
     \ /
      Last update: 2010-05-16 05:39    [W:4.074 / U:0.564 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site