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
174 lock->name = name;174 lock->name = name;
175}175}
176 176
177void
178rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task)
179{
180}
181
182void 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
9 * This file contains macros used solely by rtmutex.c. Debug version.9 * This file contains macros used solely by rtmutex.c. Debug version.
10 */10 */
11 11
12extern void
13rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task);
14extern void rt_mutex_deadlock_account_unlock(struct task_struct *task);
15extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);12extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
16extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);13extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
17extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name);14extern 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
938 */938 */
939 rt_mutex_set_owner(lock, task);939 rt_mutex_set_owner(lock, task);
940 940
941 rt_mutex_deadlock_account_lock(lock, task);
942
943 return 1;941 return 1;
944}942}
945 943
@@ -1342,8 +1340,6 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, · 396 unmodified lines
1342 1340
1343 debug_rt_mutex_unlock(lock);1341 debug_rt_mutex_unlock(lock);
1344 1342
1345 rt_mutex_deadlock_account_unlock(current);
1346
1347 /*1343 /*
1348 * We must be careful here if the fast path is enabled. If we1344 * We must be careful here if the fast path is enabled. If we
1349 * have no waiters queued we cannot set owner to NULL here1345 * 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
1409 struct hrtimer_sleeper *timeout,1405 struct hrtimer_sleeper *timeout,
1410 enum rtmutex_chainwalk chwalk))1406 enum rtmutex_chainwalk chwalk))
1411{1407{
1412 if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {1408 if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
1413 rt_mutex_deadlock_account_lock(lock, current);
1414 return 0;1409 return 0;
1415 } else1410
1416 return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);1411 return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
1417}1412}
1418 1413
1419static inline int1414static inline int
@@ -1425,21 +1420,19 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state, · 5 unmodified lines
1425 enum rtmutex_chainwalk chwalk))1420 enum rtmutex_chainwalk chwalk))
1426{1421{
1427 if (chwalk == RT_MUTEX_MIN_CHAINWALK &&1422 if (chwalk == RT_MUTEX_MIN_CHAINWALK &&
1428 likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {1423 likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
1429 rt_mutex_deadlock_account_lock(lock, current);
1430 return 0;1424 return 0;
1431 } else1425
1432 return slowfn(lock, state, timeout, chwalk);1426 return slowfn(lock, state, timeout, chwalk);
1433}1427}
1434 1428
1435static inline int1429static inline int
1436rt_mutex_fasttrylock(struct rt_mutex *lock,1430rt_mutex_fasttrylock(struct rt_mutex *lock,
1437 int (*slowfn)(struct rt_mutex *lock))1431 int (*slowfn)(struct rt_mutex *lock))
1438{1432{
1439 if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {1433 if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
1440 rt_mutex_deadlock_account_lock(lock, current);
1441 return 1;1434 return 1;
1442 }1435
1443 return slowfn(lock);1436 return slowfn(lock);
1444}1437}
1445 1438
@@ -1449,19 +1442,18 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 3 unmodified lines
1449 struct wake_q_head *wqh))1442 struct wake_q_head *wqh))
1450{1443{
1451 DEFINE_WAKE_Q(wake_q);1444 DEFINE_WAKE_Q(wake_q);
1445 bool deboost;
1452 1446
1453 if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {1447 if (likely(rt_mutex_cmpxchg_release(lock, current, NULL)))
1454 rt_mutex_deadlock_account_unlock(current);1448 return;
1455 1449
1456 } else {1450 deboost = slowfn(lock, &wake_q);
1457 bool deboost = slowfn(lock, &wake_q);
1458 1451
1459 wake_up_q(&wake_q);1452 wake_up_q(&wake_q);
1460 1453
1461 /* Undo pi boosting if necessary: */1454 /* Undo pi boosting if necessary: */
1462 if (deboost)1455 if (deboost)
1463 rt_mutex_adjust_prio(current);1456 rt_mutex_adjust_prio(current);
1464 }
1465}1457}
1466 1458
1467/**1459/**
@@ -1572,10 +1564,9 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock); · 104 unmodified lines
1572bool __sched rt_mutex_futex_unlock(struct rt_mutex *lock,1564bool __sched rt_mutex_futex_unlock(struct rt_mutex *lock,
1573 struct wake_q_head *wqh)1565 struct wake_q_head *wqh)
1574{1566{
1575 if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {1567 if (likely(rt_mutex_cmpxchg_release(lock, current, NULL)))
1576 rt_mutex_deadlock_account_unlock(current);
1577 return false;1568 return false;
1578 }1569
1579 return rt_mutex_slowunlock(lock, wqh);1570 return rt_mutex_slowunlock(lock, wqh);
1580}1571}
1581 1572
@@ -1637,7 +1628,6 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, · 55 unmodified lines
1637 __rt_mutex_init(lock, NULL);1628 __rt_mutex_init(lock, NULL);
1638 debug_rt_mutex_proxy_lock(lock, proxy_owner);1629 debug_rt_mutex_proxy_lock(lock, proxy_owner);
1639 rt_mutex_set_owner(lock, proxy_owner);1630 rt_mutex_set_owner(lock, proxy_owner);
1640 rt_mutex_deadlock_account_lock(lock, proxy_owner);
1641}1631}
1642 1632
1643/**1633/**
@@ -1657,7 +1647,6 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock, · 13 unmodified lines
1657{1647{
1658 debug_rt_mutex_proxy_unlock(lock);1648 debug_rt_mutex_proxy_unlock(lock);
1659 rt_mutex_set_owner(lock, NULL);1649 rt_mutex_set_owner(lock, NULL);
1660 rt_mutex_deadlock_account_unlock(proxy_owner);
1661}1650}
1662 1651
1663/**1652/**
kernel/locking/rtmutex.h+0−2
@@ -11,8 +11,6 @@ · 10 unmodified lines
11 */11 */
12 12
13#define rt_mutex_deadlock_check(l) (0)13#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)
16#define debug_rt_mutex_init_waiter(w) do { } while (0)14#define debug_rt_mutex_init_waiter(w) do { } while (0)
17#define debug_rt_mutex_free_waiter(w) do { } while (0)15#define debug_rt_mutex_free_waiter(w) do { } while (0)
18#define debug_rt_mutex_lock(l) do { } while (0)16#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