[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45338B92.9000201@redhat.com>
Date: Mon, 16 Oct 2006 09:39:30 -0400
From: Prarit Bhargava <prarit@...hat.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] ->signal->tty locking
Peter Zijlstra wrote:
> Oleg wrote:
> "Historically ->signal/->sighand (both ptrs and their contents) were globally
> protected by tasklist_lock. 'current' can use these pointers lockless, they
> can't be changed under him.
>
> Nowadays ->signal/->sighand are _also_ protected by ->sighand->siglock.
> Unless you are current, you can't lock ->siglock directly (without holding
> tasklist_lock), you should use lock_task_sighand()."
>
> Then, to be consistent with the rest of the kernel, ->signal->tty
> locking should look like so:
>
> mutex_lock(&tty_mutex)
> read_lock(&tasklist_lock)
> lock_task_sighand(p, &flags)
>
It would be nice if we could clean up some of the complicated locking in
this code. For example, from do_tty_hangup,
*
* Locking:
* BKL
* redirect lock for undoing redirection
* file list lock for manipulating list of ttys
* tty_ldisc_lock from called functions
* termios_sem resetting termios data
* tasklist_lock to walk task list for hangup event
P.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists