+ lockdep-allow-read_lock-recursion-of-same-class.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     lockdep: allow read_lock() recursion of same class

has been added to the -mm tree.  Its filename is

     lockdep-allow-read_lock-recursion-of-same-class.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: lockdep: allow read_lock() recursion of same class
From: Ingo Molnar <mingo@xxxxxxx>

lockdep so far only allowed read-recursion for the same lock instance. 
This is enough in the overwhelming majority of cases, but a hostap case
triggered and reported by Miles Lane relies on same-class
different-instance recursion.  So we relax the restriction on read-lock
recursion.

(this change does not allow rwsem read-recursion, which is still
forbidden.)

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 kernel/lockdep.c       |    5 ++---
 lib/locking-selftest.c |    8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff -puN kernel/lockdep.c~lockdep-allow-read_lock-recursion-of-same-class kernel/lockdep.c
--- a/kernel/lockdep.c~lockdep-allow-read_lock-recursion-of-same-class
+++ a/kernel/lockdep.c
@@ -843,10 +843,9 @@ check_deadlock(struct task_struct *curr,
 			continue;
 		/*
 		 * Allow read-after-read recursion of the same
-		 * lock instance (i.e. read_lock(lock)+read_lock(lock)):
+		 * lock class (i.e. read_lock(lock)+read_lock(lock)):
 		 */
-		if ((read == 2) && prev->read &&
-				(prev->instance == next_instance))
+		if ((read == 2) && prev->read)
 			return 2;
 		return print_deadlock_bug(curr, prev, next);
 	}
diff -puN lib/locking-selftest.c~lockdep-allow-read_lock-recursion-of-same-class lib/locking-selftest.c
--- a/lib/locking-selftest.c~lockdep-allow-read_lock-recursion-of-same-class
+++ a/lib/locking-selftest.c
@@ -248,7 +248,7 @@ GENERATE_TESTCASE(AA_rsem)
 
 /*
  * Special-case for read-locking, they are
- * allowed to recurse on the same lock instance:
+ * allowed to recurse on the same lock class:
  */
 static void rlock_AA1(void)
 {
@@ -259,7 +259,7 @@ static void rlock_AA1(void)
 static void rlock_AA1B(void)
 {
 	RL(X1);
-	RL(X2); // this one should fail
+	RL(X2); // this one should NOT fail
 }
 
 static void rsem_AA1(void)
@@ -1132,7 +1132,7 @@ void locking_selftest(void)
 	init_shared_classes();
 	debug_locks_silent = !debug_locks_verbose;
 
-	DO_TESTCASE_6("A-A deadlock", AA);
+	DO_TESTCASE_6R("A-A deadlock", AA);
 	DO_TESTCASE_6R("A-B-B-A deadlock", ABBA);
 	DO_TESTCASE_6R("A-B-B-C-C-A deadlock", ABBCCA);
 	DO_TESTCASE_6R("A-B-C-A-B-C deadlock", ABCABC);
@@ -1153,7 +1153,7 @@ void locking_selftest(void)
 
 	print_testname("recursive read-lock #2");
 	printk("             |");
-	dotest(rlock_AA1B, FAILURE, LOCKTYPE_RWLOCK);
+	dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK);
 	printk("             |");
 	dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM);
 	printk("\n");
_

Patches currently in -mm which might be from mingo@xxxxxxx are

origin.patch
irq-flags-consolidate-flags-for-request_irq.patch
irq-flags-alpha-use-the-new-irqf_-constansts.patch
irq-flags-arm26-use-the-new-irqf_-constansts.patch
irq-flags-arm-use-the-new-irqf_-constansts.patch
irq-flags-chris-use-the-new-irqf_-constansts.patch
irq-flags-frv-use-the-new-irqf_-constansts.patch
irq-flags-h8300-use-the-new-irqf_-constansts.patch
irq-flags-i386-use-the-new-irqf_-constansts.patch
irq-flags-ia64-use-the-new-irqf_-constansts.patch
irq-flags-m32r-use-the-new-irqf_-constansts.patch
irq-flags-m68knommu-use-the-new-irqf_-constansts.patch
irq-flags-m68k-use-the-new-irqf_-constansts.patch
irq-flags-mips-use-the-new-irqf_-constansts.patch
irq-flags-parisc-use-the-new-irqf_-constansts.patch
irq-flags-powerpc-use-the-new-irqf_-constansts.patch
irq-flags-ppc-use-the-new-irqf_-constansts.patch
irq-flags-s390-use-the-new-irqf_-constansts.patch
irq-flags-sh64-use-the-new-irqf_-constansts.patch
irq-flags-sh-use-the-new-irqf_-constansts.patch
irq-flags-sparc64-use-the-new-irqf_-constansts.patch
irq-flags-sparc-use-the-new-irqf_-constansts.patch
irq-flags-um-use-the-new-irqf_-constansts.patch
irq-flags-v850-use-the-new-irqf_-constansts.patch
irq-flags-x86_64-use-the-new-irqf_-constansts.patch
irq-flags-xtensa-use-the-new-irqf_-constansts.patch
irq-flags-generic-irq-use-the-new-irqf_-constansts.patch
irq-flags-drivers-block-use-the-new-irqf_-constansts.patch
irq-flags-drivers-char-use-the-new-irqf_-constansts.patch
irq-flags-drivers-drm-use-the-new-irqf_-constansts.patch
irq-flags-ide-use-the-new-irqf_-constansts.patch
irq-flags-firewire-use-the-new-irqf_-constansts.patch
irq-flags-isdn-use-the-new-irqf_-constansts.patch
irq-flags-media-use-the-new-irqf_-constansts.patch
irq-flags-misc-drivers-use-the-new-irqf_-constansts.patch
irq-flags-drivers-net-use-the-new-irqf_-constansts.patch
irq-flags-parisc-use-the-new-irqf_-constansts-2.patch
irq-flags-pci-use-the-new-irqf_-constansts.patch
irq-flags-rio-use-the-new-irqf_-constansts.patch
irq-flags-scsi-use-the-new-irqf_-constansts.patch
irq-flags-serial-use-the-new-irqf_-constansts.patch
irq-flags-usb-use-the-new-irqf_-constansts.patch
irq-flags-video-use-the-new-irqf_-constansts.patch
irq-flags-sound-use-the-new-irqf_-constansts.patch
irq-flags-documentation-use-the-new-irqf_-constansts.patch
lockdep-floppyc-irq-release-fix.patch
lockdep-console_init-after-local_irq_enable.patch
lockdep-add-is_module_address.patch
lockdep-add-print_ip_sym.patch
lockdep-add-per_cpu_offset.patch
lockdep-add-disable-enable_irq_lockdep-api.patch
lockdep-add-local_irq_enable_in_hardirq-api.patch
lockdep-add-declare_completion_onstack-api.patch
lockdep-clean-up-rwsems.patch
lockdep-remove-rwsem_debug-remnants.patch
lockdep-rename-debug_warn_on.patch
lockdep-remove-debug_bug_on.patch
lockdep-remove-mutex-deadlock-checking-code.patch
lockdep-better-lock-debugging.patch
lockdep-mutex-section-binutils-workaround.patch
lockdep-locking-init-debugging-improvement.patch
lockdep-beautify-x86_64-stacktraces.patch
lockdep-x86_64-document-stack-frame-internals.patch
lockdep-i386-remove-multi-entry-backtraces.patch
lockdep-stacktrace-subsystem-core.patch
lockdep-s390-config_frame_pointer-support.patch
lockdep-stacktrace-subsystem-i386-support.patch
lockdep-stacktrace-subsystem-x86_64-support.patch
lockdep-stacktrace-subsystem-s390-support.patch
lockdep-irqtrace-subsystem-core.patch
lockdep-irqtrace-subsystem-docs.patch
lockdep-irqtrace-subsystem-i386-support.patch
lockdep-irqtrace-cleanup-of-include-asm-i386-irqflagsh.patch
lockdep-irqtrace-subsystem-x86_64-support.patch
lockdep-irqtrace-cleanup-of-include-asm-x86_64-irqflagsh.patch
lockdep-irqtrace-subsystem-s390-support.patch
lockdep-locking-api-self-tests.patch
lockdep-core.patch
lockdep-allow-read_lock-recursion-of-same-class.patch
lockdep-design-docs.patch
lockdep-procfs.patch
lockdep-prove-rwsem-locking-correctness.patch
lockdep-prove-spinlock-rwlock-locking-correctness.patch
lockdep-prove-mutex-locking-correctness.patch
lockdep-kconfig.patch
lockdep-print-all-lock-classes-on-sysrq-d.patch
lockdep-x86_64-early-init.patch
lockdep-x86-smp-alternatives-workaround.patch
lockdep-do-not-recurse-in-printk.patch
lockdep-fix-rt_hash_lock_sz.patch
lockdep-s390-turn-validator-off-in-machine-check-handler.patch
lockdep-enable-on-i386.patch
lockdep-enable-on-x86_64.patch
lockdep-enable-on-s390.patch
lockdep-annotate-direct-io.patch
lockdep-annotate-serial.patch
lockdep-annotate-dcache.patch
lockdep-annotate-i_mutex.patch
lockdep-annotate-futex.patch
lockdep-annotate-genirq.patch
lockdep-annotate-waitqueues.patch
lockdep-annotate-mm.patch
lockdep-annotate-serio.patch
lockdep-annotate-skb_queue_head_init.patch
lockdep-annotate-timer-base-locks.patch
lockdep-annotate-scheduler-runqueue-locks.patch
lockdep-annotate-hrtimer-base-locks.patch
lockdep-annotate-sock_lock_init.patch
lockdep-annotate-af_unix-locking.patch
lockdep-annotate-bh_lock_sock.patch
lockdep-annotate-ieee1394-skb-queue-head-locking.patch
lockdep-annotate-mmap_sem.patch
lockdep-annotate-sunrpc-code.patch
lockdep-annotate-ntfs-locking-rules.patch
lockdep-annotate-the-quota-code.patch
lockdep-annotate-usbfs.patch
lockdep-annotate-sound-core-seq-seq_portsc.patch
lockdep-annotate-sound-core-seq-seq_devicec.patch
lockdep-annotate-8390c-disable_irq.patch
lockdep-annotate-3c59xc-disable_irq.patch
lockdep-annotate-enable_in_hardirq.patch
lockdep-annotate-on-stack-completions.patch
lockdep-annotate-qeth-driver.patch
lockdep-annotate-s_lock.patch
lockdep-annotate-sb-s_umount.patch
lockdep-annotate-slab-code.patch
lockdep-annotate-blkdev-nesting.patch
lockdep-annotate-vlan-net-device-as-being-a-special-class.patch
lockdep-annotate-on-stack-completions-mmc.patch
lockdep-annotate-sk_locks.patch
lockdep-annotate-hostap-netdev-xmit_lock.patch
lockdep-irqtrace-subsystem-move-account_system_vtime-calls-into-kernel-softirqc.patch
lockdep-special-s390-print_symbol-version.patch
bcm43xx-netlink-deadlock-fix.patch
lockdep-annotate-forcedethc-disable_irq.patch
disable-debugging-version-of-write_lock.patch
lock-validator-fix-ns83820c-irq-flags-bug.patch
revert-gregkh-pci-pci-test-that-drivers-properly-call-pci_set_master.patch
sched-clean-up-fallout-of-recent-changes.patch
sched-cleanup-remove-task_t-convert-to-struct-task_struct.patch
sched-cleanup-convert-schedc-internal-typedefs-to-struct.patch
sched-fix-bug-in-__migrate_task.patch
small-kernel-schedc-cleanup.patch
sched-group-cpu-power-setup-cleanup.patch
x86-re-enable-generic-numa.patch
sched-add-above-background-load-function.patch
mm-implement-swap-prefetching.patch
sched-cleanup-remove-task_t-convert-to-struct-task_struct-prefetch.patch
genirq-convert-the-x86_64-architecture-to-irq-chips.patch
genirq-convert-the-i386-architecture-to-irq-chips.patch
genirq-irq-convert-the-move_irq-flag-from-a-32bit-word-to-a-single-bit.patch
genirq-irq-add-moved_masked_irq.patch
genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch
genirq-msi-simplify-msi-enable-and-disable.patch
genirq-msi-make-the-msi-boolean-tests-return-either-0-or-1.patch
genirq-msi-implement-helper-functions-read_msi_msg-and-write_msi_msg.patch
genirq-msi-refactor-the-msi_ops.patch
genirq-msi-simplify-the-msi-irq-limit-policy.patch
genirq-irq-add-a-dynamic-irq-creation-api.patch
genirq-ia64-irq-dynamic-irq-support.patch
genirq-i386-irq-dynamic-irq-support.patch
genirq-x86_64-irq-dynamic-irq-support.patch
genirq-msi-make-the-msi-code-irq-based-and-not-vector-based.patch
genirq-x86_64-irq-move-msi-message-composition-into-io_apicc.patch
genirq-i386-irq-move-msi-message-composition-into-io_apicc.patch
genirq-msi-only-build-msi-apicc-on-ia64.patch
genirq-x86_64-irq-remove-the-msi-assumption-that-irq-==-vector.patch
genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch
genirq-irq-remove-msi-hacks.patch
genirq-irq-generalize-the-check-for-hardirq_bits.patch
genirq-x86_64-irq-make-the-external-irq-handlers-report-their-vector-not-the-irq-number.patch
genirq-x86_64-irq-make-vector_irq-per-cpu.patch
genirq-x86_64-irq-kill-gsi_irq_sharing.patch
genirq-x86_64-irq-kill-irq-compression.patch
detect-atomic-counter-underflows.patch
debug-shared-irqs.patch
make-frame_pointer-default=y.patch
mutex-subsystem-synchro-test-module.patch
vdso-print-fatal-signals.patch
vdso-improve-print_fatal_signals-support-by-adding-memory-maps.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux