History

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar: "A paravirt UP-patching fix, and an I2C MUX driver lockdep warning fix" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/pvqspinlock/x86: Use LOCK_PREFIX in __pv_queued_spin_unlock() assembly code i2c/mux, locking/core: Annotate the nested rt_mutex usage locking/rtmutex: Allow specifying a subclass for nested locking

Linus Torvalds committed 8 years ago

Commit fb20c032 parents d464b03 c0dc3735 files · +36 −8Browse files

Showing the changes to kernel (1 of 5 files). Show all

Unified · Split

kernel/locking/rtmutex.c+25−4
@@ -1465,6 +1465,29 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 1464 unmodified lines
14651465 rt_mutex_postunlock(&wake_q);
14661466 }
14671467
1468+static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass)
1469+{
1470+ might_sleep();
1471+
1472+ mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
1473+ rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock);
1474+}
1475+
1476+#ifdef CONFIG_DEBUG_LOCK_ALLOC
1477+/**
1478+ * rt_mutex_lock_nested - lock a rt_mutex
1479+ *
1480+ * @lock: the rt_mutex to be locked
1481+ * @subclass: the lockdep subclass
1482+ */
1483+void __sched rt_mutex_lock_nested(struct rt_mutex *lock, unsigned int subclass)
1484+{
1485+ __rt_mutex_lock(lock, subclass);
1486+}
1487+EXPORT_SYMBOL_GPL(rt_mutex_lock_nested);
1488+#endif
1489+
1490+#ifndef CONFIG_DEBUG_LOCK_ALLOC
14681491 /**
14691492 * rt_mutex_lock - lock a rt_mutex
14701493 *
@@ -1472,12 +1495,10 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 1 unmodified line
14721495 */
14731496 void __sched rt_mutex_lock(struct rt_mutex *lock)
14741497 {
1475− might_sleep();
1476−
1477− mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_);
1478− rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock);
1498+ __rt_mutex_lock(lock, 0);
14791499 }
14801500 EXPORT_SYMBOL_GPL(rt_mutex_lock);
1501+#endif
14811502
14821503 /**
14831504 * rt_mutex_lock_interruptible - lock a rt_mutex interruptible

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t