+ lockdep-spin_lock_irqsave_nested.patch added to -mm tree

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

 



The patch titled
     lockdep: spin_lock_irqsave_nested()
has been added to the -mm tree.  Its filename is
     lockdep-spin_lock_irqsave_nested.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: spin_lock_irqsave_nested()
From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>

Introduce spin_lock_irqsave_nested(); implementation from:
 http://lkml.org/lkml/2006/6/1/122
Patch from:
 http://lkml.org/lkml/2006/9/13/258

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
Signed-off-by: Jiri Kosina <jikos@xxxxxxxx>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Acked-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/spinlock.h         |   15 +++++++++++++++
 include/linux/spinlock_api_smp.h |    2 ++
 include/linux/spinlock_api_up.h  |    1 +
 kernel/spinlock.c                |   21 +++++++++++++++++++++
 4 files changed, 39 insertions(+)

diff -puN include/linux/spinlock_api_smp.h~lockdep-spin_lock_irqsave_nested include/linux/spinlock_api_smp.h
--- a/include/linux/spinlock_api_smp.h~lockdep-spin_lock_irqsave_nested
+++ a/include/linux/spinlock_api_smp.h
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t 
 void __lockfunc _write_lock_irq(rwlock_t *lock)		__acquires(lock);
 unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
 							__acquires(lock);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+							__acquires(spinlock_t);
 unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
 							__acquires(lock);
 unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
diff -puN include/linux/spinlock_api_up.h~lockdep-spin_lock_irqsave_nested include/linux/spinlock_api_up.h
--- a/include/linux/spinlock_api_up.h~lockdep-spin_lock_irqsave_nested
+++ a/include/linux/spinlock_api_up.h
@@ -59,6 +59,7 @@
 #define _read_lock_irq(lock)			__LOCK_IRQ(lock)
 #define _write_lock_irq(lock)			__LOCK_IRQ(lock)
 #define _spin_lock_irqsave(lock, flags)		__LOCK_IRQSAVE(lock, flags)
+#define _spin_lock_irqsave_nested(lock, flags, subclass) __LOCK_IRQSAVE(lock, flags, subclass)
 #define _read_lock_irqsave(lock, flags)		__LOCK_IRQSAVE(lock, flags)
 #define _write_lock_irqsave(lock, flags)	__LOCK_IRQSAVE(lock, flags)
 #define _spin_trylock(lock)			({ __LOCK(lock); 1; })
diff -puN include/linux/spinlock.h~lockdep-spin_lock_irqsave_nested include/linux/spinlock.h
--- a/include/linux/spinlock.h~lockdep-spin_lock_irqsave_nested
+++ a/include/linux/spinlock.h
@@ -199,6 +199,21 @@ do {								\
 		BUILD_CHECK_IRQ_FLAGS(flags);		\
 		flags = _write_lock_irqsave(lock);	\
 	} while (0)
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#define spin_lock_irqsave_nested(lock, flags, subclass)			\
+	do {								\
+		BUILD_CHECK_IRQ_FLAGS(flags);				\
+		flags = _spin_lock_irqsave_nested(lock, subclass);	\
+	} while (0)
+#else
+#define spin_lock_irqsave_nested(lock, flags, subclass)			\
+	do {								\
+		BUILD_CHECK_IRQ_FLAGS(flags);				\
+		flags = _spin_lock_irqsave(lock);			\
+	} while (0)
+#endif
+
 #else
 #define spin_lock_irqsave(lock, flags)			\
 	do {						\
diff -puN kernel/spinlock.c~lockdep-spin_lock_irqsave_nested kernel/spinlock.c
--- a/kernel/spinlock.c~lockdep-spin_lock_irqsave_nested
+++ a/kernel/spinlock.c
@@ -293,6 +293,27 @@ void __lockfunc _spin_lock_nested(spinlo
 }
 
 EXPORT_SYMBOL(_spin_lock_nested);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	preempt_disable();
+	spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
+	/*
+	 * On lockdep we dont want the hand-coded irq-enable of
+	 * _raw_spin_lock_flags() code, because lockdep assumes
+	 * that interrupts are not re-enabled during lock-acquire:
+	 */
+#ifdef CONFIG_PROVE_SPIN_LOCKING
+	_raw_spin_lock(lock);
+#else
+	_raw_spin_lock_flags(lock, &flags);
+#endif
+	return flags;
+}
+
+EXPORT_SYMBOL(_spin_lock_irqsave_nested);
 
 #endif
 
_

Patches currently in -mm which might be from arjan@xxxxxxxxxxxxxxx are

binfmt_elf-randomize-pie-binaries.patch
lockdep-spin_lock_irqsave_nested.patch
remove-the-old-bd_mutex-lockdep-annotation.patch
new-bd_mutex-lockdep-annotation.patch
round_jiffies-infrastructure.patch
round_jiffies-infrastructure-fix.patch
user-of-the-jiffies-rounding-patch-ata-subsystem.patch
user-of-the-jiffies-rounding-code-jbd.patch
user-of-the-jiffies-rounding-code-networking.patch
user-of-the-jiffies-rounding-patch-slab.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