]> git.itanic.dy.fi Git - linux-stable/commitdiff
futex: Remove rt_mutex_deadlock_account_*()
authorPeter Zijlstra <peterz@infradead.org>
Wed, 3 Feb 2021 13:45:31 +0000 (13:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:09:23 +0000 (09:09 +0100)
These are unused and clutter up the code.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: juri.lelli@arm.com
Cc: bigeasy@linutronix.de
Cc: xlpang@redhat.com
Cc: rostedt@goodmis.org
Cc: mathieu.desnoyers@efficios.com
Cc: jdesfossez@efficios.com
Cc: dvhart@infradead.org
Cc: bristot@redhat.com
Link: http://lkml.kernel.org/r/20170322104151.652692478@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[Lee: Back-ported to solve a dependency]
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/locking/rtmutex-debug.c
kernel/locking/rtmutex-debug.h
kernel/locking/rtmutex.c
kernel/locking/rtmutex.h

index 62b6cee8ea7f9e7f9dab390011775863af71e597..0613c4b1d059657d803cbfe84eff2d1d16e2dc76 100644 (file)
@@ -173,12 +173,3 @@ void debug_rt_mutex_init(struct rt_mutex *lock, const char *name)
        lock->name = name;
 }
 
-void
-rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task)
-{
-}
-
-void rt_mutex_deadlock_account_unlock(struct task_struct *task)
-{
-}
-
index d0519c3432b678b8c5de116b939cde12fa6db152..b585af9a1b508ea28007a05f4804606c336f14bd 100644 (file)
@@ -9,9 +9,6 @@
  * This file contains macros used solely by rtmutex.c. Debug version.
  */
 
-extern void
-rt_mutex_deadlock_account_lock(struct rt_mutex *lock, struct task_struct *task);
-extern void rt_mutex_deadlock_account_unlock(struct task_struct *task);
 extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
 extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
 extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name);
index 38e6cd23d2e76c6305065ff1039d033ae8ff287f..de302c580d65d43d6a46871b3b9cab638249c110 100644 (file)
@@ -956,8 +956,6 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task,
         */
        rt_mutex_set_owner(lock, task);
 
-       rt_mutex_deadlock_account_lock(lock, task);
-
        return 1;
 }
 
@@ -1365,8 +1363,6 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
 
        debug_rt_mutex_unlock(lock);
 
-       rt_mutex_deadlock_account_unlock(current);
-
        /*
         * We must be careful here if the fast path is enabled. If we
         * have no waiters queued we cannot set owner to NULL here
@@ -1432,11 +1428,10 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state,
                                struct hrtimer_sleeper *timeout,
                                enum rtmutex_chainwalk chwalk))
 {
-       if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
-               rt_mutex_deadlock_account_lock(lock, current);
+       if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
                return 0;
-       } else
-               return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
+
+       return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
 }
 
 static inline int
@@ -1448,21 +1443,19 @@ rt_mutex_timed_fastlock(struct rt_mutex *lock, int state,
                                      enum rtmutex_chainwalk chwalk))
 {
        if (chwalk == RT_MUTEX_MIN_CHAINWALK &&
-           likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
-               rt_mutex_deadlock_account_lock(lock, current);
+           likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
                return 0;
-       } else
-               return slowfn(lock, state, timeout, chwalk);
+
+       return slowfn(lock, state, timeout, chwalk);
 }
 
 static inline int
 rt_mutex_fasttrylock(struct rt_mutex *lock,
                     int (*slowfn)(struct rt_mutex *lock))
 {
-       if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) {
-               rt_mutex_deadlock_account_lock(lock, current);
+       if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current)))
                return 1;
-       }
+
        return slowfn(lock);
 }
 
@@ -1472,19 +1465,18 @@ rt_mutex_fastunlock(struct rt_mutex *lock,
                                   struct wake_q_head *wqh))
 {
        WAKE_Q(wake_q);
+       bool deboost;
 
-       if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {
-               rt_mutex_deadlock_account_unlock(current);
+       if (likely(rt_mutex_cmpxchg_release(lock, current, NULL)))
+               return;
 
-       } else {
-               bool deboost = slowfn(lock, &wake_q);
+       deboost = slowfn(lock, &wake_q);
 
-               wake_up_q(&wake_q);
+       wake_up_q(&wake_q);
 
-               /* Undo pi boosting if necessary: */
-               if (deboost)
-                       rt_mutex_adjust_prio(current);
-       }
+       /* Undo pi boosting if necessary: */
+       if (deboost)
+               rt_mutex_adjust_prio(current);
 }
 
 /**
@@ -1682,7 +1674,6 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
        __rt_mutex_init(lock, NULL);
        debug_rt_mutex_proxy_lock(lock, proxy_owner);
        rt_mutex_set_owner(lock, proxy_owner);
-       rt_mutex_deadlock_account_lock(lock, proxy_owner);
 }
 
 /**
@@ -1698,7 +1689,6 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock,
 {
        debug_rt_mutex_proxy_unlock(lock);
        rt_mutex_set_owner(lock, NULL);
-       rt_mutex_deadlock_account_unlock(proxy_owner);
 }
 
 /**
index c4060584c40769a3174aebcf7cc7ff245d7363c3..6607802efa8bd3e5fb93b72b88f613b24c158dc1 100644 (file)
@@ -11,8 +11,6 @@
  */
 
 #define rt_mutex_deadlock_check(l)                     (0)
-#define rt_mutex_deadlock_account_lock(m, t)           do { } while (0)
-#define rt_mutex_deadlock_account_unlock(l)            do { } while (0)
 #define debug_rt_mutex_init_waiter(w)                  do { } while (0)
 #define debug_rt_mutex_free_waiter(w)                  do { } while (0)
 #define debug_rt_mutex_lock(l)                         do { } while (0)