rpms/kernel/FC-5 linux-2.6-lockdep-fixes.patch,1.2,1.3
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Sep 27 21:39:30 UTC 2006
Author: davej
Update of /cvs/dist/rpms/kernel/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv12903
Modified Files:
linux-2.6-lockdep-fixes.patch
Log Message:
update lockdep fixes
linux-2.6-lockdep-fixes.patch:
a/drivers/ieee1394/nodemgr.c | 9
a/drivers/net/forcedeth.c | 31 +--
a/fs/nfsd/nfsproc.c | 2
a/fs/nfsd/vfs.c | 8
a/include/linux/nfsd/nfsfh.h | 11 -
a/kernel/lockdep.c | 13 +
a/net/ipv6/tcp_ipv6.c | 2
b/net/core/dev.c | 14 -
b/net/sched/cls_api.c | 4
b/net/sched/sch_api.c | 16 -
b/net/sched/sch_generic.c | 66 ++----
fs/block_dev.c | 11 -
linux-2.6.17-mm6/include/net/sock.h | 33 +++
linux-2.6.17.noarch/drivers/char/rtc.c | 5
linux-2.6.18-rc1/drivers/input/serio/libps2.c | 6
linux-2.6.18-rc1/include/linux/libps2.h | 12 +
linux-2.6.18-rc1/net/socket.c | 8
linux-2.6.18.noarch/block/ioctl.c | 4
linux-2.6.18.noarch/drivers/char/sysrq.c | 17 +
linux-2.6.18.noarch/drivers/input/serio/libps2.c | 4
linux-2.6.18.noarch/drivers/input/serio/serio.c | 9
linux-2.6.18.noarch/drivers/md/md.c | 6
linux-2.6.18.noarch/drivers/usb/serial/cyberjack.c | 6
linux-2.6.18.noarch/drivers/usb/serial/generic.c | 6
linux-2.6.18.noarch/drivers/usb/serial/ipw.c | 6
linux-2.6.18.noarch/drivers/usb/serial/ir-usb.c | 6
linux-2.6.18.noarch/drivers/usb/serial/keyspan_pda.c | 6
linux-2.6.18.noarch/drivers/usb/serial/omninet.c | 6
linux-2.6.18.noarch/drivers/usb/serial/safe_serial.c | 6
linux-2.6.18.noarch/fs/block_dev.c | 180 +++++--------------
linux-2.6.18.noarch/include/linux/fs.h | 17 -
linux-2.6.18.noarch/include/linux/lockdep.h | 12 -
linux-2.6.18.noarch/include/linux/serio.h | 1
linux-2.6.18.noarch/kernel/lockdep.c | 10 -
linux-2.6.18.noarch/kernel/mutex-debug.c | 2
linux-2.6.18.noarch/lib/rwsem-spinlock.c | 2
linux-2.6.18.noarch/lib/rwsem.c | 2
linux-2.6.18.noarch/lib/spinlock_debug.c | 4
linux-2.6.18.noarch/net/core/sock.c | 2
linux-2.6/mm/slab.c | 55 ++++-
40 files changed, 323 insertions(+), 297 deletions(-)
Index: linux-2.6-lockdep-fixes.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-5/linux-2.6-lockdep-fixes.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-lockdep-fixes.patch 27 Sep 2006 05:50:14 -0000 1.2
+++ linux-2.6-lockdep-fixes.patch 27 Sep 2006 21:39:28 -0000 1.3
@@ -1110,3 +1110,1754 @@
{
struct device *dev;
_
+
+From davej Wed Sep 27 09:55:00 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:55:00 -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;
+ Wed, 27 Sep 2006 09:54:29 -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 k8RDsSZQ026931;
+ Wed, 27 Sep 2006 09:54:29 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDsMUs001165;
+ Wed, 27 Sep 2006 09:54:22 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDsMl09783;
+ Wed, 27 Sep 2006 09:54:22 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09583
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVsL000816
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrUji009096
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:30 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 1B097A36B19; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134442.999713000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 1/6] remove the old bd_mutex lockdep annotation
+Content-Disposition: inline; filename=remove_old_block_annotation.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:42 +0200
+Status: RO
+Content-Length: 11383
+Lines: 380
+
+Remove the old complex and crufty bd_mutex annotation.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Neil Brown <neilb at cse.unsw.edu.au>
+Cc: Ingo Molnar <mingo at elte.hu>
+Acked-by: Arjan van de Ven <arjan at linux.intel.com>
+Cc: Jason Baron <jbaron at redhat.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+---
+ block/ioctl.c | 4 -
+ drivers/md/md.c | 6 -
+ fs/block_dev.c | 180 ++++++++++++++++-------------------------------------
+ include/linux/fs.h | 17 -----
+ 4 files changed, 60 insertions(+), 147 deletions(-)
+
+Index: linux-2.6.18.noarch/drivers/md/md.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/md/md.c
++++ linux-2.6.18.noarch/drivers/md/md.c
+@@ -1408,7 +1408,7 @@ static int lock_rdev(mdk_rdev_t *rdev, d
+ struct block_device *bdev;
+ char b[BDEVNAME_SIZE];
+
+- bdev = open_partition_by_devnum(dev, FMODE_READ|FMODE_WRITE);
++ bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE);
+ if (IS_ERR(bdev)) {
+ printk(KERN_ERR "md: could not open %s.\n",
+ __bdevname(dev, b));
+@@ -1418,7 +1418,7 @@ static int lock_rdev(mdk_rdev_t *rdev, d
+ if (err) {
+ printk(KERN_ERR "md: could not bd_claim %s.\n",
+ bdevname(bdev, b));
+- blkdev_put_partition(bdev);
++ blkdev_put(bdev);
+ return err;
+ }
+ rdev->bdev = bdev;
+@@ -1432,7 +1432,7 @@ static void unlock_rdev(mdk_rdev_t *rdev
+ if (!bdev)
+ MD_BUG();
+ bd_release(bdev);
+- blkdev_put_partition(bdev);
++ blkdev_put(bdev);
+ }
+
+ void md_autodetect_dev(dev_t dev);
+Index: linux-2.6.18.noarch/fs/block_dev.c
+===================================================================
+--- linux-2.6.18.noarch.orig/fs/block_dev.c
++++ linux-2.6.18.noarch/fs/block_dev.c
+@@ -739,7 +739,7 @@ static int bd_claim_by_kobject(struct bl
+ if (!bo)
+ return -ENOMEM;
+
+- mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_PARTITION);
++ mutex_lock(&bdev->bd_mutex);
+ res = bd_claim(bdev, holder);
+ if (res || !add_bd_holder(bdev, bo))
+ free_bd_holder(bo);
+@@ -764,7 +764,7 @@ static void bd_release_from_kobject(stru
+ if (!kobj)
+ return;
+
+- mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_PARTITION);
++ mutex_lock(&bdev->bd_mutex);
+ bd_release(bdev);
+ if ((bo = del_bd_holder(bdev, kobj)))
+ free_bd_holder(bo);
+@@ -822,22 +822,6 @@ struct block_device *open_by_devnum(dev_
+
+ EXPORT_SYMBOL(open_by_devnum);
+
+-static int
+-blkdev_get_partition(struct block_device *bdev, mode_t mode, unsigned flags);
+-
+-struct block_device *open_partition_by_devnum(dev_t dev, unsigned mode)
+-{
+- struct block_device *bdev = bdget(dev);
+- int err = -ENOMEM;
+- int flags = mode & FMODE_WRITE ? O_RDWR : O_RDONLY;
+- if (bdev)
+- err = blkdev_get_partition(bdev, mode, flags);
+- return err ? ERR_PTR(err) : bdev;
+-}
+-
+-EXPORT_SYMBOL(open_partition_by_devnum);
+-
+-
+ /*
+ * This routine checks whether a removable media has been changed,
+ * and invalidates all buffer-cache-entries in that case. This
+@@ -884,66 +868,7 @@ void bd_set_size(struct block_device *bd
+ }
+ EXPORT_SYMBOL(bd_set_size);
+
+-static int __blkdev_put(struct block_device *bdev, unsigned int subclass)
+-{
+- int ret = 0;
+- struct inode *bd_inode = bdev->bd_inode;
+- struct gendisk *disk = bdev->bd_disk;
+-
+- mutex_lock_nested(&bdev->bd_mutex, subclass);
+- lock_kernel();
+- if (!--bdev->bd_openers) {
+- sync_blockdev(bdev);
+- kill_bdev(bdev);
+- }
+- if (bdev->bd_contains == bdev) {
+- if (disk->fops->release)
+- ret = disk->fops->release(bd_inode, NULL);
+- } else {
+- mutex_lock_nested(&bdev->bd_contains->bd_mutex,
+- subclass + 1);
+- bdev->bd_contains->bd_part_count--;
+- mutex_unlock(&bdev->bd_contains->bd_mutex);
+- }
+- if (!bdev->bd_openers) {
+- struct module *owner = disk->fops->owner;
+-
+- put_disk(disk);
+- module_put(owner);
+-
+- if (bdev->bd_contains != bdev) {
+- kobject_put(&bdev->bd_part->kobj);
+- bdev->bd_part = NULL;
+- }
+- bdev->bd_disk = NULL;
+- bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info;
+- if (bdev != bdev->bd_contains)
+- __blkdev_put(bdev->bd_contains, subclass + 1);
+- bdev->bd_contains = NULL;
+- }
+- unlock_kernel();
+- mutex_unlock(&bdev->bd_mutex);
+- bdput(bdev);
+- return ret;
+-}
+-
+-int blkdev_put(struct block_device *bdev)
+-{
+- return __blkdev_put(bdev, BD_MUTEX_NORMAL);
+-}
+-EXPORT_SYMBOL(blkdev_put);
+-
+-int blkdev_put_partition(struct block_device *bdev)
+-{
+- return __blkdev_put(bdev, BD_MUTEX_PARTITION);
+-}
+-EXPORT_SYMBOL(blkdev_put_partition);
+-
+-static int
+-blkdev_get_whole(struct block_device *bdev, mode_t mode, unsigned flags);
+-
+-static int
+-do_open(struct block_device *bdev, struct file *file, unsigned int subclass)
++static int do_open(struct block_device *bdev, struct file *file)
+ {
+ struct module *owner = NULL;
+ struct gendisk *disk;
+@@ -960,8 +885,7 @@ do_open(struct block_device *bdev, struc
+ }
+ owner = disk->fops->owner;
+
+- mutex_lock_nested(&bdev->bd_mutex, subclass);
+-
++ mutex_lock(&bdev->bd_mutex);
+ if (!bdev->bd_openers) {
+ bdev->bd_disk = disk;
+ bdev->bd_contains = bdev;
+@@ -988,11 +912,11 @@ do_open(struct block_device *bdev, struc
+ ret = -ENOMEM;
+ if (!whole)
+ goto out_first;
+- ret = blkdev_get_whole(whole, file->f_mode, file->f_flags);
++ ret = blkdev_get(whole, file->f_mode, file->f_flags);
+ if (ret)
+ goto out_first;
+ bdev->bd_contains = whole;
+- mutex_lock_nested(&whole->bd_mutex, BD_MUTEX_WHOLE);
++ mutex_lock(&whole->bd_mutex);
+ whole->bd_part_count++;
+ p = disk->part[part - 1];
+ bdev->bd_inode->i_data.backing_dev_info =
+@@ -1020,8 +944,7 @@ do_open(struct block_device *bdev, struc
+ if (bdev->bd_invalidated)
+ rescan_partitions(bdev->bd_disk, bdev);
+ } else {
+- mutex_lock_nested(&bdev->bd_contains->bd_mutex,
+- BD_MUTEX_PARTITION);
++ mutex_lock(&bdev->bd_contains->bd_mutex);
+ bdev->bd_contains->bd_part_count++;
+ mutex_unlock(&bdev->bd_contains->bd_mutex);
+ }
+@@ -1035,7 +958,7 @@ out_first:
+ bdev->bd_disk = NULL;
+ bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info;
+ if (bdev != bdev->bd_contains)
+- __blkdev_put(bdev->bd_contains, BD_MUTEX_WHOLE);
++ blkdev_put(bdev->bd_contains);
+ bdev->bd_contains = NULL;
+ put_disk(disk);
+ module_put(owner);
+@@ -1062,49 +985,11 @@ int blkdev_get(struct block_device *bdev
+ fake_file.f_dentry = &fake_dentry;
+ fake_dentry.d_inode = bdev->bd_inode;
+
+- return do_open(bdev, &fake_file, BD_MUTEX_NORMAL);
++ return do_open(bdev, &fake_file);
+ }
+
+ EXPORT_SYMBOL(blkdev_get);
+
+-static int
+-blkdev_get_whole(struct block_device *bdev, mode_t mode, unsigned flags)
+-{
+- /*
+- * This crockload is due to bad choice of ->open() type.
+- * It will go away.
+- * For now, block device ->open() routine must _not_
+- * examine anything in 'inode' argument except ->i_rdev.
+- */
+- struct file fake_file = {};
+- struct dentry fake_dentry = {};
+- fake_file.f_mode = mode;
+- fake_file.f_flags = flags;
+- fake_file.f_dentry = &fake_dentry;
+- fake_dentry.d_inode = bdev->bd_inode;
+-
+- return do_open(bdev, &fake_file, BD_MUTEX_WHOLE);
+-}
+-
+-static int
+-blkdev_get_partition(struct block_device *bdev, mode_t mode, unsigned flags)
+-{
+- /*
+- * This crockload is due to bad choice of ->open() type.
+- * It will go away.
+- * For now, block device ->open() routine must _not_
+- * examine anything in 'inode' argument except ->i_rdev.
+- */
+- struct file fake_file = {};
+- struct dentry fake_dentry = {};
+- fake_file.f_mode = mode;
+- fake_file.f_flags = flags;
+- fake_file.f_dentry = &fake_dentry;
+- fake_dentry.d_inode = bdev->bd_inode;
+-
+- return do_open(bdev, &fake_file, BD_MUTEX_PARTITION);
+-}
+-
+ static int blkdev_open(struct inode * inode, struct file * filp)
+ {
+ struct block_device *bdev;
+@@ -1120,7 +1005,7 @@ static int blkdev_open(struct inode * in
+
+ bdev = bd_acquire(inode);
+
+- res = do_open(bdev, filp, BD_MUTEX_NORMAL);
++ res = do_open(bdev, filp);
+ if (res)
+ return res;
+
+@@ -1134,6 +1019,51 @@ static int blkdev_open(struct inode * in
+ return res;
+ }
+
++int blkdev_put(struct block_device *bdev)
++{
++ int ret = 0;
++ struct inode *bd_inode = bdev->bd_inode;
++ struct gendisk *disk = bdev->bd_disk;
++
++ mutex_lock(&bdev->bd_mutex);
++ lock_kernel();
++ if (!--bdev->bd_openers) {
++ sync_blockdev(bdev);
++ kill_bdev(bdev);
++ }
++ if (bdev->bd_contains == bdev) {
++ if (disk->fops->release)
++ ret = disk->fops->release(bd_inode, NULL);
++ } else {
++ mutex_lock(&bdev->bd_contains->bd_mutex);
++ bdev->bd_contains->bd_part_count--;
++ mutex_unlock(&bdev->bd_contains->bd_mutex);
++ }
++ if (!bdev->bd_openers) {
++ struct module *owner = disk->fops->owner;
++
++ put_disk(disk);
++ module_put(owner);
++
++ if (bdev->bd_contains != bdev) {
++ kobject_put(&bdev->bd_part->kobj);
++ bdev->bd_part = NULL;
++ }
++ bdev->bd_disk = NULL;
++ bdev->bd_inode->i_data.backing_dev_info = &default_backing_dev_info;
++ if (bdev != bdev->bd_contains) {
++ blkdev_put(bdev->bd_contains);
++ }
++ bdev->bd_contains = NULL;
++ }
++ unlock_kernel();
++ mutex_unlock(&bdev->bd_mutex);
++ bdput(bdev);
++ return ret;
++}
++
++EXPORT_SYMBOL(blkdev_put);
++
+ static int blkdev_close(struct inode * inode, struct file * filp)
+ {
+ struct block_device *bdev = I_BDEV(filp->f_mapping->host);
+Index: linux-2.6.18.noarch/include/linux/fs.h
+===================================================================
+--- linux-2.6.18.noarch.orig/include/linux/fs.h
++++ linux-2.6.18.noarch/include/linux/fs.h
+@@ -440,21 +440,6 @@ struct block_device {
+ };
+
+ /*
+- * bdev->bd_mutex nesting subclasses for the lock validator:
+- *
+- * 0: normal
+- * 1: 'whole'
+- * 2: 'partition'
+- */
+-enum bdev_bd_mutex_lock_class
+-{
+- BD_MUTEX_NORMAL,
+- BD_MUTEX_WHOLE,
+- BD_MUTEX_PARTITION
+-};
+-
+-
+-/*
+ * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
+ * radix trees
+ */
+@@ -1447,7 +1432,6 @@ extern void bd_set_size(struct block_dev
+ extern void bd_forget(struct inode *inode);
+ extern void bdput(struct block_device *);
+ extern struct block_device *open_by_devnum(dev_t, unsigned);
+-extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
+ extern const struct file_operations def_blk_fops;
+ extern const struct address_space_operations def_blk_aops;
+ extern const struct file_operations def_chr_fops;
+@@ -1458,7 +1442,6 @@ extern int blkdev_ioctl(struct inode *,
+ extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
+ extern int blkdev_get(struct block_device *, mode_t, unsigned);
+ extern int blkdev_put(struct block_device *);
+-extern int blkdev_put_partition(struct block_device *);
+ extern int bd_claim(struct block_device *, void *);
+ extern void bd_release(struct block_device *);
+ #ifdef CONFIG_SYSFS
+Index: linux-2.6.18.noarch/block/ioctl.c
+===================================================================
+--- linux-2.6.18.noarch.orig/block/ioctl.c
++++ linux-2.6.18.noarch/block/ioctl.c
+@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_devi
+ bdevp = bdget_disk(disk, part);
+ if (!bdevp)
+ return -ENOMEM;
+- mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
++ mutex_lock(&bdevp->bd_mutex);
+ if (bdevp->bd_openers) {
+ mutex_unlock(&bdevp->bd_mutex);
+ bdput(bdevp);
+@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_devi
+ fsync_bdev(bdevp);
+ invalidate_bdev(bdevp, 0);
+
+- mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
++ mutex_lock(&bdev->bd_mutex);
+ delete_partition(disk, part);
+ mutex_unlock(&bdev->bd_mutex);
+ mutex_unlock(&bdevp->bd_mutex);
+
+--
+
+From davej Wed Sep 27 09:54:48 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:54:48 -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;
+ Wed, 27 Sep 2006 09:54:08 -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 k8RDs83H026851;
+ Wed, 27 Sep 2006 09:54:08 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDs4kd001022;
+ Wed, 27 Sep 2006 09:54:04 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDs4l09639;
+ Wed, 27 Sep 2006 09:54:04 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09573
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVA9000814
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:31 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrUji009097
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:30 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 2B810A36B1A; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134443.088803000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 2/6] new bd_mutex lockdep annotation
+Content-Disposition: inline; filename=new_block_annotation.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:43 +0200
+Status: RO
+Content-Length: 1581
+Lines: 53
+
+Use the gendisk partition number to set a lock class.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Neil Brown <neilb at cse.unsw.edu.au>
+Cc: Ingo Molnar <mingo at elte.hu>
+Acked-by: Arjan van de Ven <arjan at linux.intel.com>
+Cc: Jason Baron <jbaron at redhat.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+---
+ fs/block_dev.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+Index: linux-2.6.18.noarch/fs/block_dev.c
+===================================================================
+--- linux-2.6.18.noarch.orig/fs/block_dev.c
++++ linux-2.6.18.noarch/fs/block_dev.c
+@@ -260,7 +260,6 @@ static void init_once(void * foo, kmem_c
+ SLAB_CTOR_CONSTRUCTOR)
+ {
+ memset(bdev, 0, sizeof(*bdev));
+- mutex_init(&bdev->bd_mutex);
+ mutex_init(&bdev->bd_mount_mutex);
+ INIT_LIST_HEAD(&bdev->bd_inodes);
+ INIT_LIST_HEAD(&bdev->bd_list);
+@@ -353,10 +352,14 @@ static int bdev_set(struct inode *inode,
+
+ static LIST_HEAD(all_bdevs);
+
++static struct lock_class_key bdev_part_lock_key;
++
+ struct block_device *bdget(dev_t dev)
+ {
+ struct block_device *bdev;
+ struct inode *inode;
++ struct gendisk *disk;
++ int part = 0;
+
+ inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
+ bdev_test, bdev_set, &dev);
+@@ -382,6 +385,11 @@ struct block_device *bdget(dev_t dev)
+ list_add(&bdev->bd_list, &all_bdevs);
+ spin_unlock(&bdev_lock);
+ unlock_new_inode(inode);
++ mutex_init(&bdev->bd_mutex);
++ disk = get_gendisk(dev, &part);
++ if (disk && part)
++ lockdep_set_class(&bdev->bd_mutex, &bdev_part_lock_key);
++ put_disk(disk);
+ }
+ return bdev;
+ }
+
+--
+
+From davej Wed Sep 27 09:54:57 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:54:57 -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;
+ Wed, 27 Sep 2006 09:54:25 -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 k8RDsOct026915;
+ Wed, 27 Sep 2006 09:54:24 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDsJLG001122;
+ Wed, 27 Sep 2006 09:54:19 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDsIl09760;
+ Wed, 27 Sep 2006 09:54:18 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09585
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVtq000818
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrUji009098
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:30 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 311A4A36B1D; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134443.177936000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 3/6] usb-serial: irq lock inversion (PPP vs. usb-serial)
+Content-Disposition: inline; filename=usb-serial-ppp.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:44 +0200
+Status: RO
+Content-Length: 10537
+Lines: 261
+
+=========================================================
+[ INFO: possible irq lock inversion dependency detected ]
+---------------------------------------------------------
+ksoftirqd/0/3 just changed the state of lock:
+ (&ap->xmit_lock){-+..}, at: [<f9337224>] ppp_async_push+0x2f/0x3b3 [ppp_async]
+but this lock took another, soft-irq-unsafe lock in the past:
+ (&port->lock){--..}
+
+and interrupts could create inverse lock ordering between them.
+
+
+other info that might help us debug this:
+no locks held by ksoftirqd/0/3.
+
+the first lock's dependencies:
+-> (&ap->xmit_lock){-+..} ops: 0 {
+ initial-use at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c06086a8>] _spin_lock_bh+0x1e/0x2d
+ [<f9337224>] ppp_async_push+0x2f/0x3b3 [ppp_async]
+ [<f93375b8>] ppp_async_send+0x10/0x3d [ppp_async]
+ [<f932f071>] ppp_channel_push+0x3a/0x94 [ppp_generic]
+ [<f9330395>] ppp_write+0xd5/0xe1 [ppp_generic]
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+ in-softirq-W at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c06086a8>] _spin_lock_bh+0x1e/0x2d
+ [<f9337224>] ppp_async_push+0x2f/0x3b3 [ppp_async]
+ [<f9337aea>] ppp_async_process+0x48/0x5b [ppp_async]
+ [<c04294b4>] tasklet_action+0x65/0xca
+ [<c04293d5>] __do_softirq+0x78/0xf2
+ [<c040662f>] do_softirq+0x5a/0xbe
+ hardirq-on-W at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c06086a8>] _spin_lock_bh+0x1e/0x2d
+ [<f9337224>] ppp_async_push+0x2f/0x3b3 [ppp_async]
+ [<f93375b8>] ppp_async_send+0x10/0x3d [ppp_async]
+ [<f932f071>] ppp_channel_push+0x3a/0x94 [ppp_generic]
+ [<f9330395>] ppp_write+0xd5/0xe1 [ppp_generic]
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+ }
+ ... key at: [<f933b208>] __key.19284+0x0/0xffffce72 [ppp_async]
+ -> (&port->lock){--..} ops: 0 {
+ initial-use at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c060867b>] _spin_lock+0x19/0x28
+ [<f9324478>] usb_serial_generic_write+0x79/0x23d [usbserial]
+ [<f9322531>] serial_write+0x8a/0x99 [usbserial]
+ [<c052dbed>] write_chan+0x22e/0x2a8
+ [<c052b530>] tty_write+0x148/0x1ce
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+ softirq-on-W at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c060867b>] _spin_lock+0x19/0x28
+ [<f9324478>] usb_serial_generic_write+0x79/0x23d [usbserial]
+ [<f9322531>] serial_write+0x8a/0x99 [usbserial]
+ [<c052dbed>] write_chan+0x22e/0x2a8
+ [<c052b530>] tty_write+0x148/0x1ce
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+ hardirq-on-W at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c060867b>] _spin_lock+0x19/0x28
+ [<f9324478>] usb_serial_generic_write+0x79/0x23d [usbserial]
+ [<f9322531>] serial_write+0x8a/0x99 [usbserial]
+ [<c052dbed>] write_chan+0x22e/0x2a8
+ [<c052b530>] tty_write+0x148/0x1ce
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+ }
+ ... key at: [<f932b08c>] __key.15523+0x0/0xffff9965 [usbserial]
+ ... acquired at:
+ [<c043bf43>] lock_acquire+0x4b/0x6c
+ [<c060867b>] _spin_lock+0x19/0x28
+ [<f9324478>] usb_serial_generic_write+0x79/0x23d [usbserial]
+ [<f9322531>] serial_write+0x8a/0x99 [usbserial]
+ [<f933729c>] ppp_async_push+0xa7/0x3b3 [ppp_async]
+ [<f93375da>] ppp_async_send+0x32/0x3d [ppp_async]
+ [<f932f071>] ppp_channel_push+0x3a/0x94 [ppp_generic]
+ [<f9330395>] ppp_write+0xd5/0xe1 [ppp_generic]
+ [<c0471f23>] vfs_write+0xab/0x157
+ [<c0472568>] sys_write+0x3b/0x60
+ [<c0403faf>] syscall_call+0x7/0xb
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Greg KH <greg at kroah.com>
+Cc: Paul Mackerras <paulus at samba.org>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+---
+ drivers/usb/serial/cyberjack.c | 6 +++---
+ drivers/usb/serial/generic.c | 6 +++---
+ drivers/usb/serial/ipw.c | 6 +++---
+ drivers/usb/serial/ir-usb.c | 6 +++---
+ drivers/usb/serial/keyspan_pda.c | 6 +++---
+ drivers/usb/serial/omninet.c | 6 +++---
+ drivers/usb/serial/safe_serial.c | 6 +++---
+ 7 files changed, 21 insertions(+), 21 deletions(-)
+
+Index: linux-2.6.18.noarch/drivers/usb/serial/cyberjack.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/cyberjack.c
++++ linux-2.6.18.noarch/drivers/usb/serial/cyberjack.c
+@@ -214,14 +214,14 @@ static int cyberjack_write (struct usb_s
+ return (0);
+ }
+
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ spin_lock_irqsave(&priv->lock, flags);
+
+Index: linux-2.6.18.noarch/drivers/usb/serial/generic.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/generic.c
++++ linux-2.6.18.noarch/drivers/usb/serial/generic.c
+@@ -175,14 +175,14 @@ int usb_serial_generic_write(struct usb_
+
+ /* only do something if we have a bulk out endpoint */
+ if (serial->num_bulk_out) {
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ count = (count > port->bulk_out_size) ? port->bulk_out_size : count;
+
+Index: linux-2.6.18.noarch/drivers/usb/serial/ipw.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/ipw.c
++++ linux-2.6.18.noarch/drivers/usb/serial/ipw.c
+@@ -394,14 +394,14 @@ static int ipw_write(struct usb_serial_p
+ return 0;
+ }
+
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ count = min(count, port->bulk_out_size);
+ memcpy(port->bulk_out_buffer, buf, count);
+Index: linux-2.6.18.noarch/drivers/usb/serial/ir-usb.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/ir-usb.c
++++ linux-2.6.18.noarch/drivers/usb/serial/ir-usb.c
+@@ -342,14 +342,14 @@ static int ir_write (struct usb_serial_p
+ if (count == 0)
+ return 0;
+
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ transfer_buffer = port->write_urb->transfer_buffer;
+ transfer_size = min(count, port->bulk_out_size - 1);
+Index: linux-2.6.18.noarch/drivers/usb/serial/keyspan_pda.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/keyspan_pda.c
++++ linux-2.6.18.noarch/drivers/usb/serial/keyspan_pda.c
+@@ -518,13 +518,13 @@ static int keyspan_pda_write(struct usb_
+ the TX urb is in-flight (wait until it completes)
+ the device is full (wait until it says there is room)
+ */
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy || priv->tx_throttled) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ /* At this point the URB is in our control, nobody else can submit it
+ again (the only sudden transition was the one from EINPROGRESS to
+Index: linux-2.6.18.noarch/drivers/usb/serial/omninet.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/omninet.c
++++ linux-2.6.18.noarch/drivers/usb/serial/omninet.c
+@@ -256,14 +256,14 @@ static int omninet_write (struct usb_ser
+ return (0);
+ }
+
+- spin_lock(&wport->lock);
++ spin_lock_bh(&wport->lock);
+ if (wport->write_urb_busy) {
+- spin_unlock(&wport->lock);
++ spin_unlock_bh(&wport->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ wport->write_urb_busy = 1;
+- spin_unlock(&wport->lock);
++ spin_unlock_bh(&wport->lock);
+
+ count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count;
+
+Index: linux-2.6.18.noarch/drivers/usb/serial/safe_serial.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/usb/serial/safe_serial.c
++++ linux-2.6.18.noarch/drivers/usb/serial/safe_serial.c
+@@ -298,14 +298,14 @@ static int safe_write (struct usb_serial
+ dbg ("%s - write request of 0 bytes", __FUNCTION__);
+ return (0);
+ }
+- spin_lock(&port->lock);
++ spin_lock_bh(&port->lock);
+ if (port->write_urb_busy) {
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+ dbg("%s - already writing", __FUNCTION__);
+ return 0;
+ }
+ port->write_urb_busy = 1;
+- spin_unlock(&port->lock);
++ spin_unlock_bh(&port->lock);
+
+ packet_length = port->bulk_out_size; // get max packetsize
+
+
+--
+
+From davej Wed Sep 27 09:54:53 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:54:53 -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;
+ Wed, 27 Sep 2006 09:54:17 -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 k8RDsHSL026893;
+ Wed, 27 Sep 2006 09:54:17 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDsCLt001074;
+ Wed, 27 Sep 2006 09:54:12 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDsCl09713;
+ Wed, 27 Sep 2006 09:54:12 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09580
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVcE000817
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrUji009099
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:30 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 354E1A36B1F; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134443.301120000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 4/6] lockdep: lockdep_set_class_and_subclass
+Content-Disposition: inline; filename=lockdep-init-subclass.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:45 +0200
+Status: RO
+Content-Length: 7379
+Lines: 188
+
+Add lockdep_set_class_and_subclass() to the lockdep annotations.
+
+This annotation makes it possible to assign a subclass on lock init. This
+annotation is meant to reduce the _nested() annotations by assigning a
+default subclass.
+
+One could do without this annotation and rely on lockdep_set_class()
+exclusively, but that would require a manual stack of struct lock_class_key
+objects.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Acked-by: Ingo Molnar <mingo at elte.hu>
+---
+ include/linux/lockdep.h | 12 ++++++++----
+ kernel/lockdep.c | 10 ++++++----
+ kernel/mutex-debug.c | 2 +-
+ lib/rwsem-spinlock.c | 2 +-
+ lib/rwsem.c | 2 +-
+ lib/spinlock_debug.c | 4 ++--
+ net/core/sock.c | 2 +-
+ 7 files changed, 20 insertions(+), 14 deletions(-)
+
+Index: linux-2.6.18.noarch/include/linux/lockdep.h
+===================================================================
+--- linux-2.6.18.noarch.orig/include/linux/lockdep.h
++++ linux-2.6.18.noarch/include/linux/lockdep.h
+@@ -202,7 +202,7 @@ extern int lockdep_internal(void);
+ */
+
+ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
+- struct lock_class_key *key);
++ struct lock_class_key *key, int subclass);
+
+ /*
+ * Reinitialize a lock key - for cases where there is special locking or
+@@ -211,9 +211,11 @@ extern void lockdep_init_map(struct lock
+ * or they are too narrow (they suffer from a false class-split):
+ */
+ #define lockdep_set_class(lock, key) \
+- lockdep_init_map(&(lock)->dep_map, #key, key)
++ lockdep_init_map(&(lock)->dep_map, #key, key, 0)
+ #define lockdep_set_class_and_name(lock, key, name) \
+- lockdep_init_map(&(lock)->dep_map, name, key)
++ lockdep_init_map(&(lock)->dep_map, name, key, 0)
++#define lockdep_set_class_and_subclass(lock, key, sub) \
++ lockdep_init_map(&(lock)->dep_map, #key, key, sub)
+
+ /*
+ * Acquire a lock.
+@@ -257,10 +259,12 @@ static inline int lockdep_internal(void)
+ # define lock_release(l, n, i) do { } while (0)
+ # define lockdep_init() do { } while (0)
+ # define lockdep_info() do { } while (0)
+-# define lockdep_init_map(lock, name, key) do { (void)(key); } while (0)
++# define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0)
+ # define lockdep_set_class(lock, key) do { (void)(key); } while (0)
+ # define lockdep_set_class_and_name(lock, key, name) \
+ do { (void)(key); } while (0)
++#define lockdep_set_class_and_subclass(lock, key, sub) \
++ do { (void)(key); } while (0)
+ # define INIT_LOCKDEP
+ # define lockdep_reset() do { debug_locks = 1; } while (0)
+ # define lockdep_free_key_range(start, size) do { } while (0)
+Index: linux-2.6.18.noarch/kernel/lockdep.c
+===================================================================
+--- linux-2.6.18.noarch.orig/kernel/lockdep.c
++++ linux-2.6.18.noarch/kernel/lockdep.c
+@@ -1170,7 +1170,7 @@ look_up_lock_class(struct lockdep_map *l
+ * itself, so actual lookup of the hash should be once per lock object.
+ */
+ static inline struct lock_class *
+-register_lock_class(struct lockdep_map *lock, unsigned int subclass)
++register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
+ {
+ struct lockdep_subclass_key *key;
+ struct list_head *hash_head;
+@@ -1242,7 +1242,7 @@ register_lock_class(struct lockdep_map *
+ out_unlock_set:
+ __raw_spin_unlock(&hash_lock);
+
+- if (!subclass)
++ if (!subclass || force)
+ lock->class_cache = class;
+
+ DEBUG_LOCKS_WARN_ON(class->subclass != subclass);
+@@ -1930,7 +1930,7 @@ void trace_softirqs_off(unsigned long ip
+ * Initialize a lock instance's lock-class mapping info:
+ */
+ void lockdep_init_map(struct lockdep_map *lock, const char *name,
+- struct lock_class_key *key)
++ struct lock_class_key *key, int subclass)
+ {
+ if (unlikely(!debug_locks))
+ return;
+@@ -1950,6 +1950,8 @@ void lockdep_init_map(struct lockdep_map
+ lock->name = name;
+ lock->key = key;
+ lock->class_cache = NULL;
++ if (subclass)
++ register_lock_class(lock, subclass, 1);
+ }
+
+ EXPORT_SYMBOL_GPL(lockdep_init_map);
+@@ -1988,7 +1990,7 @@ static int __lock_acquire(struct lockdep
+ * Not cached yet or subclass?
+ */
+ if (unlikely(!class)) {
+- class = register_lock_class(lock, subclass);
++ class = register_lock_class(lock, subclass, 0);
+ if (!class)
+ return 0;
+ }
+Index: linux-2.6.18.noarch/kernel/mutex-debug.c
+===================================================================
+--- linux-2.6.18.noarch.orig/kernel/mutex-debug.c
++++ linux-2.6.18.noarch/kernel/mutex-debug.c
+@@ -91,7 +91,7 @@ void debug_mutex_init(struct mutex *lock
+ * Make sure we are not reinitializing a held lock:
+ */
+ debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+- lockdep_init_map(&lock->dep_map, name, key);
++ lockdep_init_map(&lock->dep_map, name, key, 0);
+ #endif
+ lock->owner = NULL;
+ lock->magic = lock;
+Index: linux-2.6.18.noarch/lib/rwsem-spinlock.c
+===================================================================
+--- linux-2.6.18.noarch.orig/lib/rwsem-spinlock.c
++++ linux-2.6.18.noarch/lib/rwsem-spinlock.c
+@@ -28,7 +28,7 @@ void __init_rwsem(struct rw_semaphore *s
+ * Make sure we are not reinitializing a held semaphore:
+ */
+ debug_check_no_locks_freed((void *)sem, sizeof(*sem));
+- lockdep_init_map(&sem->dep_map, name, key);
++ lockdep_init_map(&sem->dep_map, name, key, 0);
+ #endif
+ sem->activity = 0;
+ spin_lock_init(&sem->wait_lock);
+Index: linux-2.6.18.noarch/lib/rwsem.c
+===================================================================
+--- linux-2.6.18.noarch.orig/lib/rwsem.c
++++ linux-2.6.18.noarch/lib/rwsem.c
+@@ -19,7 +19,7 @@ void __init_rwsem(struct rw_semaphore *s
+ * Make sure we are not reinitializing a held semaphore:
+ */
+ debug_check_no_locks_freed((void *)sem, sizeof(*sem));
+- lockdep_init_map(&sem->dep_map, name, key);
++ lockdep_init_map(&sem->dep_map, name, key, 0);
+ #endif
+ sem->count = RWSEM_UNLOCKED_VALUE;
+ spin_lock_init(&sem->wait_lock);
+Index: linux-2.6.18.noarch/lib/spinlock_debug.c
+===================================================================
+--- linux-2.6.18.noarch.orig/lib/spinlock_debug.c
++++ linux-2.6.18.noarch/lib/spinlock_debug.c
+@@ -20,7 +20,7 @@ void __spin_lock_init(spinlock_t *lock,
+ * Make sure we are not reinitializing a held lock:
+ */
+ debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+- lockdep_init_map(&lock->dep_map, name, key);
++ lockdep_init_map(&lock->dep_map, name, key, 0);
+ #endif
+ lock->raw_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
+ lock->magic = SPINLOCK_MAGIC;
+@@ -38,7 +38,7 @@ void __rwlock_init(rwlock_t *lock, const
+ * Make sure we are not reinitializing a held lock:
+ */
+ debug_check_no_locks_freed((void *)lock, sizeof(*lock));
+- lockdep_init_map(&lock->dep_map, name, key);
++ lockdep_init_map(&lock->dep_map, name, key, 0);
+ #endif
+ lock->raw_lock = (raw_rwlock_t) __RAW_RW_LOCK_UNLOCKED;
+ lock->magic = RWLOCK_MAGIC;
+Index: linux-2.6.18.noarch/net/core/sock.c
+===================================================================
+--- linux-2.6.18.noarch.orig/net/core/sock.c
++++ linux-2.6.18.noarch/net/core/sock.c
+@@ -827,7 +827,7 @@ static void inline sock_lock_init(struct
+ af_family_slock_key_strings[sk->sk_family]);
+ lockdep_init_map(&sk->sk_lock.dep_map,
+ af_family_key_strings[sk->sk_family],
+- af_family_keys + sk->sk_family);
++ af_family_keys + sk->sk_family, 0);
+ }
+
+ /**
+
+--
+
+From davej Wed Sep 27 09:54:52 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:54:52 -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;
+ Wed, 27 Sep 2006 09:54:14 -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 k8RDsE3K026877;
+ Wed, 27 Sep 2006 09:54:14 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDs9u7001056;
+ Wed, 27 Sep 2006 09:54:09 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDs9l09690;
+ Wed, 27 Sep 2006 09:54:09 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09588
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVRb000819
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrVji009104
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:31 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 42B14A36B20; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134443.388867000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 5/6] serio: lockdep annotation for ps2dev->cmd_mutex and serio->lock
+Content-Disposition: inline; filename=serio-lockdep.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:46 +0200
+Status: RO
+Content-Length: 2636
+Lines: 76
+
+Based ideas from Jiri Kosina, this patch tracks the nesting depth
+and uses the new lockdep_set_class_and_subclass() annotation to store
+this information in the lock objects.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Acked-by: Ingo Molnar <mingo at elte.hu>
+---
+ drivers/input/serio/libps2.c | 4 ++++
+ drivers/input/serio/serio.c | 9 ++++++++-
+ include/linux/serio.h | 1 +
+ 3 files changed, 13 insertions(+), 1 deletion(-)
+
+Index: linux-2.6.18.noarch/drivers/input/serio/libps2.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/input/serio/libps2.c
++++ linux-2.6.18.noarch/drivers/input/serio/libps2.c
+@@ -280,6 +280,8 @@ int ps2_schedule_command(struct ps2dev *
+ return 0;
+ }
+
++static struct lock_class_key ps2_mutex_key;
++
+ /*
+ * ps2_init() initializes ps2dev structure
+ */
+@@ -287,6 +289,8 @@ int ps2_schedule_command(struct ps2dev *
+ void __ps2_init(struct ps2dev *ps2dev, struct serio *serio)
+ {
+ mutex_init(&ps2dev->cmd_mutex);
++ lockdep_set_class_and_subclass(&ps2dev->cmd_mutex, &ps2_mutex_key,
++ serio->depth);
+ init_waitqueue_head(&ps2dev->wait);
+ ps2dev->serio = serio;
+ }
+Index: linux-2.6.18.noarch/drivers/input/serio/serio.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/input/serio/serio.c
++++ linux-2.6.18.noarch/drivers/input/serio/serio.c
+@@ -521,6 +521,8 @@ static void serio_release_port(struct de
+ module_put(THIS_MODULE);
+ }
+
++static struct lock_class_key serio_lock_key;
++
+ /*
+ * Prepare serio port for registration.
+ */
+@@ -538,8 +540,13 @@ static void serio_init_port(struct serio
+ "serio%ld", (long)atomic_inc_return(&serio_no) - 1);
+ serio->dev.bus = &serio_bus;
+ serio->dev.release = serio_release_port;
+- if (serio->parent)
++ if (serio->parent) {
+ serio->dev.parent = &serio->parent->dev;
++ serio->depth = serio->parent->depth + 1;
++ } else
++ serio->depth = 0;
++ lockdep_set_class_and_subclass(&serio->lock, &serio_lock_key,
++ serio->depth);
+ }
+
+ /*
+Index: linux-2.6.18.noarch/include/linux/serio.h
+===================================================================
+--- linux-2.6.18.noarch.orig/include/linux/serio.h
++++ linux-2.6.18.noarch/include/linux/serio.h
+@@ -41,6 +41,7 @@ struct serio {
+ void (*stop)(struct serio *);
+
+ struct serio *parent, *child;
++ unsigned int depth; /* level of nesting in serio hierarchy */
+
+ struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
+ struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
+
+--
+
+From davej Wed Sep 27 09:54:56 2006
+Return-Path: <rhkernel-list-admin at redhat.com>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 09:54:56 -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;
+ Wed, 27 Sep 2006 09:54:20 -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 k8RDsKfH026905;
+ Wed, 27 Sep 2006 09:54:20 -0400
+Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDsFGW001102;
+ Wed, 27 Sep 2006 09:54:15 -0400
+Received: from post-office.corp.redhat.com (localhost.localdomain [127.0.0.1])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDsFl09736;
+ Wed, 27 Sep 2006 09:54:15 -0400
+Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
+ by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k8RDrWl09589
+ for <rhkernel-list at post-office.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RDrVHK000820
+ for <rhkernel-list at int-mx1.corp.redhat.com>; Wed, 27 Sep 2006 09:53:32 -0400
+Received: from taijtu.programming.kicks-ass.net (vpn-4-64.str.redhat.com [10.32.4.64])
+ by pobox.stuttgart.redhat.com (8.12.8/8.12.8) with ESMTP id k8RDrVji009105
+ for <rhkernel-list at redhat.com>; Wed, 27 Sep 2006 15:53:31 +0200
+Received: by taijtu.programming.kicks-ass.net (Postfix, from userid 0)
+ id 4B7C6A36B22; Wed, 27 Sep 2006 15:53:04 +0200 (CEST)
+Message-Id: <20060927134443.447200000 at redhat.com>
+References: <20060927133341.835683000 at redhat.com>
+User-Agent: quilt/0.45-1
+From: Peter Zijlstra <pzijlstr at redhat.com>
+Subject: [RHEL5 PATCH 6/6] sysrq: disable lockdep on reboot
+Content-Disposition: inline; filename=sysrq-b-lockdep.patch
+To: rhkernel-list at redhat.com
+X-loop: rhkernel-list at redhat.com
+Sender: rhkernel-list-admin at redhat.com
+Errors-To: rhkernel-list-admin at redhat.com
+X-BeenThere: rhkernel-list at redhat.com
+X-Mailman-Version: 2.0.13
+Precedence: bulk
+Reply-To: rhkernel-list at redhat.com
+List-Help: <mailto:rhkernel-list-request at redhat.com?subject=help>
+List-Post: <mailto:rhkernel-list at redhat.com>
+List-Subscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=subscribe>
+List-Id: Red Hat INTERNAL-ONLY kernel discussion list <rhkernel-list.redhat.com>
+List-Unsubscribe: <http://post-office.corp.redhat.com/mailman/listinfo/rhkernel-list>,
+ <mailto:rhkernel-list-request at redhat.com?subject=unsubscribe>
+List-Archive: <http://post-office.corp.redhat.com/archives/rhkernel-list/>
+Date: Wed, 27 Sep 2006 15:33:47 +0200
+Status: RO
+Content-Length: 1986
+Lines: 57
+
+SysRq : Emergency Sync
+Emergency Sync complete
+SysRq : Emergency Remount R/O
+Emergency Remount complete
+SysRq : Resetting
+BUG: warning at kernel/lockdep.c:1816/trace_hardirqs_on() (Not tainted)
+
+Call Trace:
+ [<ffffffff8026d56d>] show_trace+0xae/0x319
+ [<ffffffff8026d7ed>] dump_stack+0x15/0x17
+ [<ffffffff802a68d1>] trace_hardirqs_on+0xbc/0x13d
+ [<ffffffff803a8eec>] sysrq_handle_reboot+0x9/0x11
+ [<ffffffff803a8f8d>] __handle_sysrq+0x99/0x130
+ [<ffffffff803a903b>] handle_sysrq+0x17/0x19
+ [<ffffffff803a36ee>] kbd_event+0x32e/0x57d
+ [<ffffffff80401e35>] input_event+0x42d/0x45b
+ [<ffffffff804063eb>] atkbd_interrupt+0x44d/0x53d
+ [<ffffffff803fe5c5>] serio_interrupt+0x49/0x86
+ [<ffffffff803ff2a4>] i8042_interrupt+0x202/0x21a
+ [<ffffffff80210cf0>] handle_IRQ_event+0x2c/0x64
+ [<ffffffff802bfd8b>] __do_IRQ+0xaf/0x114
+ [<ffffffff8026ea24>] do_IRQ+0xf8/0x107
+ [<ffffffff8025f886>] ret_from_intr+0x0/0xf
+DWARF2 unwinder stuck at ret_from_intr+0x0/0xf
+Leftover inexact backtrace:
+ <IRQ> <EOI> [<ffffffff80258e36>] mwait_idle+0x3f/0x54
+ [<ffffffff8024a33a>] cpu_idle+0xa2/0xc5
+ [<ffffffff8026c34e>] rest_init+0x2b/0x2d
+ [<ffffffff809708bc>] start_kernel+0x24a/0x24c
+ [<ffffffff8097028b>] _sinittext+0x28b/0x292
+
+Since we're shutting down anyway, don't bother being smart,
+just turn the thing off.
+
+Signed-off-by: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Acked-by: Ingo Molnar <mingo at elte.hu>
+Cc: Arjan van de Ven <arjan at linux.intel.com>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+---
+
+ drivers/char/sysrq.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: linux-2.6.18.noarch/drivers/char/sysrq.c
+===================================================================
+--- linux-2.6.18.noarch.orig/drivers/char/sysrq.c
++++ linux-2.6.18.noarch/drivers/char/sysrq.c
+@@ -115,6 +115,7 @@ static struct sysrq_key_op sysrq_crashdu
+ static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
+ struct tty_struct *tty)
+ {
++ lockdep_off();
+ local_irq_enable();
+ emergency_restart();
+ }
+
+--
+
+From davej Wed Sep 27 08:07:25 2006
+Return-Path: <kaber at trash.net>
+X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on
+ pressure.kernelslacker.org
+X-Spam-Level:
+X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,
+ UNPARSEABLE_RELAY autolearn=ham version=3.1.4
+Received: from pobox.devel.redhat.com [10.11.255.8]
+ by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
+ for <davej at localhost> (single-drop); Wed, 27 Sep 2006 08:07:25 -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;
+ Wed, 27 Sep 2006 08:07:23 -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 k8RC7MuB016370
+ for <davej at pobox.devel.redhat.com>; Wed, 27 Sep 2006 08:07:22 -0400
+Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32])
+ by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k8RC7MUv027756
+ for <davej at redhat.com>; Wed, 27 Sep 2006 08:07:22 -0400
+Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14])
+ by mx3.redhat.com (8.13.1/8.13.1) with ESMTP id k8RC7Fk1028731
+ for <davej at redhat.com>; Wed, 27 Sep 2006 08:07:15 -0400
+Received: from [192.168.0.100] (port-195-158-167-105.dynamic.qsc.de [195.158.167.105])
+ by mx01.qsc.de (Postfix) with ESMTP id 8096BC7499;
+ Wed, 27 Sep 2006 14:07:04 +0200 (CEST)
+Message-ID: <451A6968.2090607 at trash.net>
+Date: Wed, 27 Sep 2006 14:07:04 +0200
+From: Patrick McHardy <kaber at trash.net>
+User-Agent: Debian Thunderbird 1.0.7 (X11/20051019)
+X-Accept-Language: en-us, en
+MIME-Version: 1.0
+To: Dave Jones <davej at redhat.com>
+CC: hadi at cyberus.ca, Jarek Poplawski <jarkao2 at o2.pl>, netdev at vger.kernel.org,
+ davem at davemloft.net
+Subject: Re: tc related lockdep warning.
+References: <20060925124352.GA1592 at ff.dom.local> <1159188473.5301.68.camel at jzny2> <4517D9A6.70307 at trash.net> <45195219.7050105 at trash.net> <20060926212034.GA3134 at redhat.com>
+In-Reply-To: <20060926212034.GA3134 at redhat.com>
+X-Enigmail-Version: 0.93.0.0
+Content-Type: multipart/mixed;
+ boundary="------------030205060600030901000206"
+X-RedHat-Spam-Score: 0.003
+Status: RO
+X-Status: A
+Content-Length: 10980
+Lines: 358
+
+This is a multi-part message in MIME format.
+--------------030205060600030901000206
+Content-Type: text/plain; charset=ISO-8859-15
+Content-Transfer-Encoding: 7bit
+
+Dave Jones wrote:
+> With this patch, I get no lockdep warnings, but the machine locks up completely.
+> I hooked up a serial console, and found this..
+>
+>
+> u32 classifier
+> Performance counters on
+> input device check on
+> Actions configured
+> BUG: warning at net/sched/sch_htb.c:395/htb_safe_rb_erase()
+>
+> Call Trace:
+> [<ffffffff8026f79b>] show_trace+0xae/0x336
+> [<ffffffff8026fa38>] dump_stack+0x15/0x17
+> [<ffffffff8860a171>] :sch_htb:htb_safe_rb_erase+0x3b/0x55
+
+I found the reason for this, it was an unrelated bug. I've attached
+the latest version of the locking fixes and the fix for the HTB bug.
+Can you please try again?
+
+
+
+--------------030205060600030901000206
+Content-Type: text/plain;
+ name="02.diff"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="02.diff"
+
+[NET_SCHED]: Fix fallout from dev->qdisc RCU change
+
+The move of qdisc destruction to a rcu callback broke locking in the
+entire qdisc layer by invalidating previously valid assumptions about
+the context in which changes to the qdisc tree occur.
+
+The two assumptions were:
+
+- since changes only happen in process context, read_lock doesn't need
+ bottem half protection. Now invalid since destruction of inner qdiscs,
+ classifiers, actions and estimators happens in the RCU callback unless
+ they're manually deleted, resulting in dead-locks when read_lock in
+ process context is interrupted by write_lock_bh in bottem half context.
+
+- since changes only happen under the RTNL, no additional locking is
+ necessary for data not used during packet processing (f.e. u32_list).
+ Again, since destruction now happens in the RCU callback, this assumption
+ is not valid anymore, causing races while using this data, which can
+ result in corruption or use-after-free.
+
+Instead of "fixing" this by disabling bottem halfs everywhere and adding
+new locks/refcounting, this patch makes these assumptions valid again by
+moving destruction back to process context. Since only the dev->qdisc
+pointer is protected by RCU, but ->enqueue and the qdisc tree are still
+protected by dev->qdisc_lock, destruction of the tree can be performed
+immediately and only the final free needs to happen in the rcu callback
+to make sure dev_queue_xmit doesn't access already freed memory.
+
+Signed-off-by: Patrick McHardy <kaber at trash.net>
+
+---
+commit fe5b95bfcde98ca2e32b4274c93889cdd1fbc040
+tree 951a0d83d91b15dbe55a41366e0fe01966fec7ed
+parent 9a0cd6d60280d88c38791844c87548d45cf6f2c2
+author Patrick McHardy <kaber at trash.net> Wed, 27 Sep 2006 13:57:18 +0200
+committer Patrick McHardy <kaber at trash.net> Wed, 27 Sep 2006 13:57:18 +0200
+
+ net/core/dev.c | 14 ++++++----
+ net/sched/cls_api.c | 4 +--
+ net/sched/sch_api.c | 16 ++++++-----
+ net/sched/sch_generic.c | 66 +++++++++++++++--------------------------------
+ 4 files changed, 39 insertions(+), 61 deletions(-)
+
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 14de297..4d891be 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -1480,14 +1480,16 @@ #endif
+ if (q->enqueue) {
+ /* Grab device queue */
+ spin_lock(&dev->queue_lock);
++ q = dev->qdisc;
++ if (q->enqueue) {
++ rc = q->enqueue(skb, q);
++ qdisc_run(dev);
++ spin_unlock(&dev->queue_lock);
+
+- rc = q->enqueue(skb, q);
+-
+- qdisc_run(dev);
+-
++ rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc;
++ goto out;
++ }
+ spin_unlock(&dev->queue_lock);
+- rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc;
+- goto out;
+ }
+
+ /* The device has no queue. Common case for software devices:
+diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
+index 7e14f14..37a1840 100644
+--- a/net/sched/cls_api.c
++++ b/net/sched/cls_api.c
+@@ -401,7 +401,7 @@ static int tc_dump_tfilter(struct sk_buf
+ if ((dev = dev_get_by_index(tcm->tcm_ifindex)) == NULL)
+ return skb->len;
+
+- read_lock_bh(&qdisc_tree_lock);
++ read_lock(&qdisc_tree_lock);
+ if (!tcm->tcm_parent)
+ q = dev->qdisc_sleeping;
+ else
+@@ -458,7 +458,7 @@ errout:
+ if (cl)
+ cops->put(q, cl);
+ out:
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+ dev_put(dev);
+ return skb->len;
+ }
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
+index a19eff1..0b64892 100644
+--- a/net/sched/sch_api.c
++++ b/net/sched/sch_api.c
+@@ -195,14 +195,14 @@ struct Qdisc *qdisc_lookup(struct net_de
+ {
+ struct Qdisc *q;
+
+- read_lock_bh(&qdisc_tree_lock);
++ read_lock(&qdisc_tree_lock);
+ list_for_each_entry(q, &dev->qdisc_list, list) {
+ if (q->handle == handle) {
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+ return q;
+ }
+ }
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+ return NULL;
+ }
+
+@@ -837,7 +837,7 @@ static int tc_dump_qdisc(struct sk_buff
+ continue;
+ if (idx > s_idx)
+ s_q_idx = 0;
+- read_lock_bh(&qdisc_tree_lock);
++ read_lock(&qdisc_tree_lock);
+ q_idx = 0;
+ list_for_each_entry(q, &dev->qdisc_list, list) {
+ if (q_idx < s_q_idx) {
+@@ -846,12 +846,12 @@ static int tc_dump_qdisc(struct sk_buff
+ }
+ if (tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid,
+ cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+ goto done;
+ }
+ q_idx++;
+ }
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+ }
+
+ done:
+@@ -1074,7 +1074,7 @@ static int tc_dump_tclass(struct sk_buff
+ s_t = cb->args[0];
+ t = 0;
+
+- read_lock_bh(&qdisc_tree_lock);
++ read_lock(&qdisc_tree_lock);
+ list_for_each_entry(q, &dev->qdisc_list, list) {
+ if (t < s_t || !q->ops->cl_ops ||
+ (tcm->tcm_parent &&
+@@ -1096,7 +1096,7 @@ static int tc_dump_tclass(struct sk_buff
+ break;
+ t++;
+ }
+- read_unlock_bh(&qdisc_tree_lock);
++ read_unlock(&qdisc_tree_lock);
+
+ cb->args[0] = t;
+
+diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
+index 6f91518..88c6a99 100644
+--- a/net/sched/sch_generic.c
++++ b/net/sched/sch_generic.c
+@@ -45,11 +45,10 @@ #include <net/pkt_sched.h>
+ The idea is the following:
+ - enqueue, dequeue are serialized via top level device
+ spinlock dev->queue_lock.
+- - tree walking is protected by read_lock_bh(qdisc_tree_lock)
++ - tree walking is protected by read_lock(qdisc_tree_lock)
+ and this lock is used only in process context.
+- - updates to tree are made under rtnl semaphore or
+- from softirq context (__qdisc_destroy rcu-callback)
+- hence this lock needs local bh disabling.
++ - updates to tree are made only under rtnl semaphore,
++ hence this lock may be made without local bh disabling.
+
+ qdisc_tree_lock must be grabbed BEFORE dev->queue_lock!
+ */
+@@ -57,14 +56,14 @@ DEFINE_RWLOCK(qdisc_tree_lock);
+
+ void qdisc_lock_tree(struct net_device *dev)
+ {
+- write_lock_bh(&qdisc_tree_lock);
++ write_lock(&qdisc_tree_lock);
+ spin_lock_bh(&dev->queue_lock);
+ }
+
+ void qdisc_unlock_tree(struct net_device *dev)
+ {
+ spin_unlock_bh(&dev->queue_lock);
+- write_unlock_bh(&qdisc_tree_lock);
++ write_unlock(&qdisc_tree_lock);
+ }
+
+ /*
+@@ -483,20 +482,6 @@ void qdisc_reset(struct Qdisc *qdisc)
+ static void __qdisc_destroy(struct rcu_head *head)
+ {
+ struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
+- struct Qdisc_ops *ops = qdisc->ops;
+-
+-#ifdef CONFIG_NET_ESTIMATOR
+- gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
+-#endif
+- write_lock(&qdisc_tree_lock);
+- if (ops->reset)
+- ops->reset(qdisc);
+- if (ops->destroy)
+- ops->destroy(qdisc);
+- write_unlock(&qdisc_tree_lock);
+- module_put(ops->owner);
+-
+- dev_put(qdisc->dev);
+ kfree((char *) qdisc - qdisc->padded);
+ }
+
+@@ -504,32 +489,23 @@ #endif
+
+ void qdisc_destroy(struct Qdisc *qdisc)
+ {
+- struct list_head cql = LIST_HEAD_INIT(cql);
+- struct Qdisc *cq, *q, *n;
++ struct Qdisc_ops *ops = qdisc->ops;
+
+ if (qdisc->flags & TCQ_F_BUILTIN ||
+- !atomic_dec_and_test(&qdisc->refcnt))
++ !atomic_dec_and_test(&qdisc->refcnt))
+ return;
+
+- if (!list_empty(&qdisc->list)) {
+- if (qdisc->ops->cl_ops == NULL)
+- list_del(&qdisc->list);
+- else
+- list_move(&qdisc->list, &cql);
+- }
+-
+- /* unlink inner qdiscs from dev->qdisc_list immediately */
+- list_for_each_entry(cq, &cql, list)
+- list_for_each_entry_safe(q, n, &qdisc->dev->qdisc_list, list)
+- if (TC_H_MAJ(q->parent) == TC_H_MAJ(cq->handle)) {
+- if (q->ops->cl_ops == NULL)
+- list_del_init(&q->list);
+- else
+- list_move_tail(&q->list, &cql);
+- }
+- list_for_each_entry_safe(cq, n, &cql, list)
+- list_del_init(&cq->list);
++ list_del(&qdisc->list);
++#ifdef CONFIG_NET_ESTIMATOR
++ gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
++#endif
++ if (ops->reset)
++ ops->reset(qdisc);
++ if (ops->destroy)
++ ops->destroy(qdisc);
+
++ module_put(ops->owner);
++ dev_put(qdisc->dev);
+ call_rcu(&qdisc->q_rcu, __qdisc_destroy);
+ }
+
+@@ -549,15 +525,15 @@ void dev_activate(struct net_device *dev
+ printk(KERN_INFO "%s: activation failed\n", dev->name);
+ return;
+ }
+- write_lock_bh(&qdisc_tree_lock);
++ write_lock(&qdisc_tree_lock);
+ list_add_tail(&qdisc->list, &dev->qdisc_list);
+- write_unlock_bh(&qdisc_tree_lock);
++ write_unlock(&qdisc_tree_lock);
+ } else {
+ qdisc = &noqueue_qdisc;
+ }
+- write_lock_bh(&qdisc_tree_lock);
++ write_lock(&qdisc_tree_lock);
+ dev->qdisc_sleeping = qdisc;
+- write_unlock_bh(&qdisc_tree_lock);
++ write_unlock(&qdisc_tree_lock);
+ }
+
+ if (!netif_carrier_ok(dev))
+
+
+--------------030205060600030901000206--
+
More information about the fedora-cvs-commits
mailing list