rpms/kernel/devel linux-2.6-lockdep-fixes.patch,1.5,1.6

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jul 10 15:32:53 UTC 2006


Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv32723

Modified Files:
	linux-2.6-lockdep-fixes.patch 
Log Message:
more lockdep fixy fixy

linux-2.6-lockdep-fixes.patch:
 linux-2.6.17-mm6/include/net/sock.h           |    6 -
 linux-2.6.17-mm6/kernel/lockdep.c             |   15 +++-
 linux-2.6.18-rc1/drivers/input/serio/libps2.c |    6 -
 linux-2.6.18-rc1/fs/block_dev.c               |    2 
 linux-2.6.18-rc1/fs/sysfs/inode.c             |   39 +++++++++++
 linux-2.6.18-rc1/include/linux/libps2.h       |    7 +-
 linux-2.6.18-rc1/include/linux/skbuff.h       |    9 ++
 linux-2.6.18-rc1/kernel/panic.c               |    2 
 linux-2.6.18-rc1/net/bluetooth/l2cap.c        |   18 ++---
 linux/arch/x86_64/kernel/smpboot.c            |    4 -
 linux/include/linux/completion.h              |   10 ++
 linux/include/linux/lockdep.h                 |    2 
 linux/kernel/lockdep.c                        |   87 ++++++++++++++++----------
 13 files changed, 147 insertions(+), 60 deletions(-)

Index: linux-2.6-lockdep-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-lockdep-fixes.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux-2.6-lockdep-fixes.patch	10 Jul 2006 15:02:48 -0000	1.5
+++ linux-2.6-lockdep-fixes.patch	10 Jul 2006 15:32:49 -0000	1.6
@@ -115,125 +115,6 @@
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
-From davej  Tue Jul  4 12:14:37 2006
-Return-path: <linux-kernel-owner+davej=40kernelslacker.org-S932258AbWGDQNH at vger.kernel.org>
-X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on 
-	nwo.kernelslacker.org
-X-Spam-Level: 
-X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
-	version=3.1.3
-Envelope-to: davej at kernelslacker.org
-Delivery-date: Tue, 04 Jul 2006 17:13:34 +0100
-Received: from testure.choralone.org [194.9.77.134]
-	by nwo.kernelslacker.org with IMAP (fetchmail-6.3.4)
-	for <davej at localhost> (single-drop); Tue, 04 Jul 2006 12:14:37 -0400 (EDT)
-Received: from vger.kernel.org ([209.132.176.167])
-	by testure.choralone.org with esmtp (Exim 4.62)
-	(envelope-from <linux-kernel-owner+davej=40kernelslacker.org-S932258AbWGDQNH at vger.kernel.org>)
-	id 1FxnWo-0005lk-9O
-	for davej at kernelslacker.org; Tue, 04 Jul 2006 17:13:34 +0100
-Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
-	id S932258AbWGDQNH (ORCPT <rfc822;davej at kernelslacker.org>);
-	Tue, 4 Jul 2006 12:13:07 -0400
-Received: (majordomo at vger.kernel.org) by vger.kernel.org id S932252AbWGDQNH
-	(ORCPT <rfc822;linux-kernel-outgoing>);
-	Tue, 4 Jul 2006 12:13:07 -0400
-Received: from pentafluge.infradead.org ([213.146.154.40]:32170 "EHLO
-	pentafluge.infradead.org") by vger.kernel.org with ESMTP
-	id S932232AbWGDQNF (ORCPT <rfc822;linux-kernel at vger.kernel.org>);
-	Tue, 4 Jul 2006 12:13:05 -0400
-Received: from a222036.upc-a.chello.nl ([62.163.222.36] helo=[172.31.3.43])
-	by pentafluge.infradead.org with esmtpsa (Exim 4.62 #1 (Red Hat Linux))
-	id 1FxnWJ-0007NJ-9e; Tue, 04 Jul 2006 17:13:03 +0100
-Subject: Re: possible recursive locking in ATM layer
-From:	Arjan van de Ven <arjan at infradead.org>
-To:	Duncan Sands <duncan.sands at math.u-psud.fr>
-Cc:	netdev at vger.kernel.org, linux-kernel at vger.kernel.org,
-	Ingo Molnar <mingo at elte.hu>, chas at cmf.nrl.navy.mil
-In-Reply-To: <200607041759.43064.duncan.sands at math.u-psud.fr>
-References: <200607041759.43064.duncan.sands at math.u-psud.fr>
-Content-Type: text/plain
-Date:	Tue, 04 Jul 2006 18:13:02 +0200
-Message-Id: <1152029582.3109.70.camel at laptopd505.fenrus.org>
-Mime-Version: 1.0
-X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) 
-Content-Transfer-Encoding: 7bit
-X-SRS-Rewrite: SMTP reverse-path rewritten from <arjan at infradead.org> by pentafluge.infradead.org
-	See http://www.infradead.org/rpr.html
-Sender:	linux-kernel-owner at vger.kernel.org
-Precedence: bulk
-X-Mailing-List:	linux-kernel at vger.kernel.org
-Status: RO
-Content-Length: 2497
-Lines: 66
-
-
-From: Arjan van de Ven <arjan at linux.intel.com>
-
-> Linux version 2.6.17-git22 (duncan at baldrick) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #20 PREEMPT Tue Jul 4 10:35:04 CEST 2006
-> 
-> [ 2381.598609] =============================================
-> [ 2381.619314] [ INFO: possible recursive locking detected ]
-> [ 2381.635497] ---------------------------------------------
-> [ 2381.651706] atmarpd/2696 is trying to acquire lock:
-> [ 2381.666354]  (&skb_queue_lock_key){-+..}, at: [<c028c540>] skb_migrate+0x24/0x6c
-> [ 2381.688848]
-
-
-ok this is a real potential deadlock in a way, it takes two locks of 2
-skbuffs without doing any kind of lock ordering; I think the following
-patch should fix it. Just sort the lock taking order by address of the
-skb.. it's not pretty but it's the best this can do in a minimally
-invasive way.
-
-I still agree with the comment that this code shouldn't live in the atm
-layer...
-
-Signed-off-by: Arjan van de Ven <arjan at linux.intel.com>
-
----
- net/atm/ipcommon.c |   13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-Index: linux-2.6.17-mm6/net/atm/ipcommon.c
-===================================================================
---- linux-2.6.17-mm6.orig/net/atm/ipcommon.c
-+++ linux-2.6.17-mm6/net/atm/ipcommon.c
-@@ -25,8 +25,8 @@
- /*
-  * skb_migrate appends the list at "from" to "to", emptying "from" in the
-  * process. skb_migrate is atomic with respect to all other skb operations on
-- * "from" and "to". Note that it locks both lists at the same time, so beware
-- * of potential deadlocks.
-+ * "from" and "to". Note that it locks both lists at the same time, so to deal
-+ * with the lock ordering, the locks are taken in address order.
-  *
-  * This function should live in skbuff.c or skbuff.h.
-  */
-@@ -39,8 +39,13 @@ void skb_migrate(struct sk_buff_head *fr
- 	struct sk_buff *skb_to = (struct sk_buff *) to;
- 	struct sk_buff *prev;
- 
--	spin_lock_irqsave(&from->lock,flags);
--	spin_lock(&to->lock);
-+	if (from<to) {
-+		spin_lock_irqsave(&from->lock,flags);
-+		spin_lock_nested(&to->lock, SINGLE_DEPTH_NESTING);
-+	} else {
-+		spin_lock_irqsave(&to->lock, flags);
-+		spin_lock_nested(&from->lock, SINGLE_DEPTH_NESTING);
-+	}
- 	prev = from->prev;
- 	from->next->prev = to->prev;
- 	prev->next = skb_to;
-
-
--
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo at vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at  http://www.tux.org/lkml/
-
 From davej  Tue Jul  4 14:33:56 2006
 Return-path: <linux-kernel-owner+davej=40kernelslacker.org-S932295AbWGDSc4 at vger.kernel.org>
 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on 
@@ -1121,3 +1002,138 @@
  			/* sysfs_dirent has non-default attributes
 
 
+From davej  Mon Jul 10 11:13:32 2006
+Return-Path: <SRS0+f93f76af6977eb5e6772+1051+infradead.org+arjan at pentafluge.srs.infradead.org>
+X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on 
+	nwo.kernelslacker.org
+X-Spam-Level: 
+X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,
+	UNPARSEABLE_RELAY autolearn=ham version=3.1.3
+Received: from pobox.devel.redhat.com [10.11.255.8]
+	by nwo.kernelslacker.org with IMAP (fetchmail-6.3.4)
+	for <davej at localhost> (single-drop); Mon, 10 Jul 2006 11:13:32 -0400 (EDT)
+Received: from pobox.devel.redhat.com ([unix socket])
+	 by pobox.devel.redhat.com (Cyrus v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1) with LMTPA;
+	 Mon, 10 Jul 2006 11:12:55 -0400
+X-Sieve: CMU Sieve 2.2
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+	by pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id k6AFCtN4021006;
+	Mon, 10 Jul 2006 11:12:55 -0400
+Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31])
+	by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k6AFCtPL011743;
+	Mon, 10 Jul 2006 11:12:55 -0400
+Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40])
+	by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k6AFCr4C009817;
+	Mon, 10 Jul 2006 11:12:53 -0400
+Received: from a222036.upc-a.chello.nl ([62.163.222.36] helo=[172.31.3.43])
+	by pentafluge.infradead.org with esmtpsa (Exim 4.62 #1 (Red Hat Linux))
+	id 1FzxRM-0000xQ-Cp; Mon, 10 Jul 2006 16:12:52 +0100
+Subject: Re: lockdep input layer warnings.
+From: Arjan van de Ven <arjan at infradead.org>
+To: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+Cc: Dave Jones <davej at redhat.com>, mingo at redhat.com,
+        Linux Kernel <linux-kernel at vger.kernel.org>
+In-Reply-To: <d120d5000607061329t4868d265h6f8285c798a0e3b7 at mail.gmail.com>
+References: <20060706173411.GA2538 at redhat.com>
+	 <d120d5000607061137r605a08f9ie6cd45a389285c4a at mail.gmail.com>
+	 <1152212575.3084.88.camel at laptopd505.fenrus.org>
+	 <d120d5000607061329t4868d265h6f8285c798a0e3b7 at mail.gmail.com>
+Content-Type: text/plain
+Date: Mon, 10 Jul 2006 17:12:51 +0200
+Message-Id: <1152544371.4874.66.camel at laptopd505.fenrus.org>
+Mime-Version: 1.0
+X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) 
+Content-Transfer-Encoding: 7bit
+X-SRS-Rewrite: SMTP reverse-path rewritten from <arjan at infradead.org> by pentafluge.infradead.org
+	See http://www.infradead.org/rpr.html
+X-RedHat-Spam-Score: 2.646 **
+Status: RO
+Content-Length: 3434
+Lines: 85
+
+On Thu, 2006-07-06 at 16:29 -0400, Dmitry Torokhov wrote:
+> On 7/6/06, Arjan van de Ven <arjan at infradead.org> wrote:
+> > On Thu, 2006-07-06 at 14:37 -0400, Dmitry Torokhov wrote:
+> > > On 7/6/06, Dave Jones <davej at redhat.com> wrote:
+> > > > One of our Fedora-devel users picked up on this this morning
+> > > > in an 18rc1 based kernel.
+> > > >
+> > > >                Dave
+> > > >
+> > > >
+> > > >  Synaptics Touchpad, model: 1, fw: 5.9, id: 0x2c6ab1, caps: 0x884793/0x0
+> > > >  serio: Synaptics pass-through port at isa0060/serio1/input0
+> > > >  input: SynPS/2 Synaptics TouchPad as /class/input/input1
+> > > >  PM: Adding info for serio:serio2
+> > > >
+> > > >  =============================================
+> > > >  [ INFO: possible recursive locking detected ]
+> > > >  ---------------------------------------------
+> > >
+> > > False alarm, there was a lockdep annotating patch for it in -mm.
+> > not so sure; that patch is supposed to be in -rc1 already; investigating
+> >
+> 
+> Well, you are right, the patch is in -rc1 and I see mutex_lock_nested
+> in the backtrace but for some reason it is still not happy. Again,
+> this is with pass-through Synaptics port and we first taking mutex of
+> the child device and then (going through pass-through port) trying to
+> take mutex of the parent.
+
+Ok it seems more drastic measures are needed; and a split of the
+cmd_mutex class on a per driver basis. The easiest way to do that is to
+inline the lock initialization (patch below) but to be honest I think
+the patch is a bit ugly; I considered inlining the entire function
+instead, any opinions on that?
+
+Index: linux-2.6.18-rc1/drivers/input/serio/libps2.c
+===================================================================
+--- linux-2.6.18-rc1.orig/drivers/input/serio/libps2.c
++++ linux-2.6.18-rc1/drivers/input/serio/libps2.c
+@@ -27,7 +27,7 @@ MODULE_AUTHOR("Dmitry Torokhov <dtor at mai
+ MODULE_DESCRIPTION("PS/2 driver library");
+ MODULE_LICENSE("GPL");
+ 
+-EXPORT_SYMBOL(ps2_init);
++EXPORT_SYMBOL(__ps2_init);
+ EXPORT_SYMBOL(ps2_sendbyte);
+ EXPORT_SYMBOL(ps2_drain);
+ EXPORT_SYMBOL(ps2_command);
+@@ -177,7 +177,7 @@ int ps2_command(struct ps2dev *ps2dev, u
+ 		return -1;
+ 	}
+ 
+-	mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
++	mutex_lock(&ps2dev->cmd_mutex);
+ 
+ 	serio_pause_rx(ps2dev->serio);
+ 	ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
+@@ -279,7 +279,7 @@ int ps2_schedule_command(struct ps2dev *
+  * ps2_init() initializes ps2dev structure
+  */
+ 
+-void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
++void __ps2_init(struct ps2dev *ps2dev, struct serio *serio)
+ {
+ 	mutex_init(&ps2dev->cmd_mutex);
+ 	init_waitqueue_head(&ps2dev->wait);
+Index: linux-2.6.18-rc1/include/linux/libps2.h
+===================================================================
+--- linux-2.6.18-rc1.orig/include/linux/libps2.h
++++ linux-2.6.18-rc1/include/linux/libps2.h
+@@ -39,7 +39,12 @@ struct ps2dev {
+ 	unsigned char nak;
+ };
+ 
+-void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
++void __ps2_init(struct ps2dev *ps2dev, struct serio *serio);
++static inline void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
++{
++	__ps2_init(ps2dev, serio);
++	mutex_init(&ps2dev->cmd_mutex);
++}
+ int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
+ void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
+ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
+
+




More information about the fedora-cvs-commits mailing list