Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934244AbZLMBsi (ORCPT ); Sat, 12 Dec 2009 20:48:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934211AbZLMBse (ORCPT ); Sat, 12 Dec 2009 20:48:34 -0500 Received: from www.tglx.de ([62.245.132.106]:34360 "HELO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S934156AbZLMBsc (ORCPT ); Sat, 12 Dec 2009 20:48:32 -0500 Date: Sat, 12 Dec 2009 23:34:07 +0100 (CET) From: Thomas Gleixner To: Alan Cox cc: Andrew Morton , Ingo Molnar , Greg KH , Peter Zijlstra , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [GIT PATCH] TTY patches for 2.6.33-git In-Reply-To: <20091212110240.194760cc@lxorguk.ukuu.org.uk> Message-ID: References: <20091211232805.GA10652@kroah.com> <20091212084611.GA28266@elte.hu> <20091212013927.58d386d1.akpm@linux-foundation.org> <20091212110240.194760cc@lxorguk.ukuu.org.uk> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2031 Lines: 61 On Sat, 12 Dec 2009, Alan Cox wrote: > > The do_tty_hangup()->tty_fasync() path takes the locks in the > > file_list_lock()->lock_kernel() direction whereas most other code takes > > them in the other direction, which cannot be good. But I'm not sure > > Thats a bug - the BKL does want to be taken first (and will > sleep/yield/drop) > > > Have a trace. I'm actually wondering if perhaps there's a missing > > unlock_kernel() somewhere else, and the tty code is just the victim of > > that. > > It's introduced by the BKL shuffle. Try the following > > > commit 1f61f07a985c7e8cfc20ad8fcced2f3d226bd0dc > Author: Alan Cox > Date: Sat Dec 12 10:32:36 2009 +0000 > > tty: Fix the AB-BA locking bug introduced in the BKL split > > The fasync path takes the BKL (it probably doesn't need to in fact) but > this causes lock inversions and deadlocks so we can't do that. Leave the > BKL over that bit for the moment. > > Identified by AKPM. > > Signed-off-by: Alan Cox Acked-and-Tested-by: Thomas Gleixner > diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c > index 684f0e0..f15df40 100644 > --- a/drivers/char/tty_io.c > +++ b/drivers/char/tty_io.c > @@ -516,7 +516,6 @@ static void do_tty_hangup(struct work_struct *work) > /* inuse_filps is protected by the single kernel lock */ > lock_kernel(); > check_tty_count(tty, "do_tty_hangup"); > - unlock_kernel(); > > file_list_lock(); > /* This breaks for file handles being sent over AF_UNIX sockets ? */ > @@ -531,7 +530,6 @@ static void do_tty_hangup(struct work_struct *work) > } > file_list_unlock(); > > - lock_kernel(); > tty_ldisc_hangup(tty); > > read_lock(&tasklist_lock); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/