History

futex: Remove rt_mutex_deadlock_account_*()

These are unused and clutter up the code.

Peter Zijlstra committed 9 years ago

Commit fffa9541 parent 1b367ec4 files · +18 −43Browse files

Showing the changes to kernel/locking (4 of 4 files). Show all

Unified · Split

4 files
  1. kernel/locking/rtmutex-debug.c +0 −9
  2. kernel/locking/rtmutex-debug.h +0 −3
  3. kernel/locking/rtmutex.c +18 −29
  4. kernel/locking/rtmutex.h +0 −2
kernel/locking/rtmutex-debug.c+0−9
@@ -174,12 +174,3 @@ void debug_rt_mutex_init(struct rt_mutex *lock, const char *name) · 173 unmodified lines
174174 lock->name = name;
175175 }
176176
177−void
178−rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task)
179−{
180−}
181−
182−void rt_mutex_deadlock_account_unlock(struct task_struct *task)
183−{
184−}
185−
kernel/locking/rtmutex-debug.h+0−3
@@ -9,9 +9,6 @@ · 8 unmodified lines
99 * This file contains macros used solely by rtmutex.c. Debug version.
1010 */
1111
12−extern void
13−rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task);
14−extern void rt_mutex_deadlock_account_unlock(struct task_struct *task);
1512 extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
1613 extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
1714 extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name);
kernel/locking/rtmutex.c+18−29
@@ -938,8 +938,6 @@ takeit: · 937 unmodified lines
938938 */
939939 rt_mutex_set_owner(lock, task);
940940
941− rt_mutex_deadlock_account_lock(lock, task);
942−
943941 return 1;
944942 }
945943
@@ -1342,8 +1340,6 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, · 396 unmodified lines
13421340
13431341 debug_rt_mutex_unlock(lock);
13441342
1345− rt_mutex_deadlock_account_unlock(current);
1346−
13471343 /*
13481344 * We must be careful here if the fast path is enabled. If we
13491345 * have no waiters queued we cannot set owner to NULL here
@@ -1409,11 +1405,10 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state, · 59 unmodified lines
14091405 struct hrtimer_sleeper *timeout,
14101406 enum rtmutex_chainwalk chwalk))
14111407 {
1412− if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
1413− rt_mutex_deadlock_account_lock(lock, current);
1408+ if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
14141409 return 0;
1415− } else
1416− return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
1410+
1411+ return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
14171412 }
14181413
14191414 static inline int
@@ -1425,21 +1420,19 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state, · 5 unmodified lines
14251420 enum rtmutex_chainwalk chwalk))
14261421 {
14271422 if (chwalk == RT_MUTEX_MIN_CHAINWALK &&
1428− likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
1429− rt_mutex_deadlock_account_lock(lock, current);
1423+ likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
14301424 return 0;
1431− } else
1432− return slowfn(lock, state, timeout, chwalk);
1425+
1426+ return slowfn(lock, state, timeout, chwalk);
14331427 }
14341428
14351429 static inline int
14361430 rt_mutex_fasttrylock(struct rt_mutex *lock,
14371431 int (*slowfn)(struct rt_mutex *lock))
14381432 {
1439− if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
1440− rt_mutex_deadlock_account_lock(lock, current);
1433+ if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
14411434 return 1;
1442− }
1435+
14431436 return slowfn(lock);
14441437 }
14451438
@@ -1449,19 +1442,18 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 3 unmodified lines
14491442 struct wake_q_head *wqh))
14501443 {
14511444 DEFINE_WAKE_Q(wake_q);
1445+ bool deboost;
14521446
1453− if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {
1454− rt_mutex_deadlock_account_unlock(current);
1447+ if (likely(rt_mutex_cmpxchg_release(lock, current, NULL)))
1448+ return;
14551449
1456− } else {
1457− bool deboost = slowfn(lock, &wake_q);
1450+ deboost = slowfn(lock, &wake_q);
14581451
1459− wake_up_q(&wake_q);
1452+ wake_up_q(&wake_q);
14601453
1461− /* Undo pi boosting if necessary: */
1462− if (deboost)
1463− rt_mutex_adjust_prio(current);
1464− }
1454+ /* Undo pi boosting if necessary: */
1455+ if (deboost)
1456+ rt_mutex_adjust_prio(current);
14651457 }
14661458
14671459 /**
@@ -1572,10 +1564,9 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock); · 104 unmodified lines
15721564 bool __sched rt_mutex_futex_unlock(struct rt_mutex *lock,
15731565 struct wake_q_head *wqh)
15741566 {
1575− if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {
1576− rt_mutex_deadlock_account_unlock(current);
1567+ if (likely(rt_mutex_cmpxchg_release(lock, current, NULL)))
15771568 return false;
1578− }
1569+
15791570 return rt_mutex_slowunlock(lock, wqh);
15801571 }
15811572
@@ -1637,7 +1628,6 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, · 55 unmodified lines
16371628 __rt_mutex_init(lock, NULL);
16381629 debug_rt_mutex_proxy_lock(lock, proxy_owner);
16391630 rt_mutex_set_owner(lock, proxy_owner);
1640− rt_mutex_deadlock_account_lock(lock, proxy_owner);
16411631 }
16421632
16431633 /**
@@ -1657,7 +1647,6 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock, · 13 unmodified lines
16571647 {
16581648 debug_rt_mutex_proxy_unlock(lock);
16591649 rt_mutex_set_owner(lock, NULL);
1660− rt_mutex_deadlock_account_unlock(proxy_owner);
16611650 }
16621651
16631652 /**
kernel/locking/rtmutex.h+0−2
@@ -11,8 +11,6 @@ · 10 unmodified lines
1111 */
1212
1313 #define rt_mutex_deadlock_check(l) (0)
14−#define rt_mutex_deadlock_account_lock(m, t) do { } while (0)
15−#define rt_mutex_deadlock_account_unlock(l) do { } while (0)
1614 #define debug_rt_mutex_init_waiter(w) do { } while (0)
1715 #define debug_rt_mutex_free_waiter(w) do { } while (0)
1816 #define debug_rt_mutex_lock(l) do { } while (0)

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