]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
locking/core: Remove cpu_relax_lowlatency() users
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 25 Oct 2016 09:03:14 +0000 (11:03 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 16 Nov 2016 09:15:10 +0000 (10:15 +0100)
With the s390 special case of a yielding cpu_relax() implementation gone,
we can now remove all users of cpu_relax_lowlatency() and replace them
with cpu_relax().

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/1477386195-32736-5-git-send-email-borntraeger@de.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/gpu/drm/i915/i915_gem_request.c
drivers/vhost/net.c
kernel/locking/mcs_spinlock.h
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/qrwlock.c
kernel/locking/rwsem-xadd.c
lib/lockref.c

index 8832f8ec158342ac305b603e0bd30d4353687fe3..383d134164424ceb5f7ffde73dc620d1af0fc69b 100644 (file)
@@ -723,7 +723,7 @@ bool __i915_spin_request(const struct drm_i915_gem_request *req,
                if (busywait_stop(timeout_us, cpu))
                        break;
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        } while (!need_resched());
 
        return false;
index 5dc128a8da83e5c724dbd1d8748fa0db2a300d7a..5dc34653274ae3655cf2ba97ab9c8dce9e8a2632 100644 (file)
@@ -342,7 +342,7 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net,
                endtime = busy_clock() + vq->busyloop_timeout;
                while (vhost_can_busy_poll(vq->dev, endtime) &&
                       vhost_vq_avail_empty(vq->dev, vq))
-                       cpu_relax_lowlatency();
+                       cpu_relax();
                preempt_enable();
                r = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov),
                                      out_num, in_num, NULL, NULL);
@@ -533,7 +533,7 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk)
                while (vhost_can_busy_poll(&net->dev, endtime) &&
                       !sk_has_rx_data(sk) &&
                       vhost_vq_avail_empty(&net->dev, vq))
-                       cpu_relax_lowlatency();
+                       cpu_relax();
 
                preempt_enable();
 
index c835270f0c2f93c24f623e9ea2ba2e94eebb006a..6a385aabcce7b1cc606d1b25ec6addfef222c664 100644 (file)
@@ -28,7 +28,7 @@ struct mcs_spinlock {
 #define arch_mcs_spin_lock_contended(l)                                        \
 do {                                                                   \
        while (!(smp_load_acquire(l)))                                  \
-               cpu_relax_lowlatency();                                 \
+               cpu_relax();                                            \
 } while (0)
 #endif
 
@@ -108,7 +108,7 @@ void mcs_spin_unlock(struct mcs_spinlock **lock, struct mcs_spinlock *node)
                        return;
                /* Wait until the next pointer is set */
                while (!(next = READ_ONCE(node->next)))
-                       cpu_relax_lowlatency();
+                       cpu_relax();
        }
 
        /* Pass lock to next waiter. */
index 17a88e929e6aaefab458ea5989c4119f601ef616..a65e09a046ac11ae6a9f38a4166e02fd898e2e62 100644 (file)
@@ -369,7 +369,7 @@ bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner)
                        break;
                }
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
        rcu_read_unlock();
 
@@ -492,7 +492,7 @@ static bool mutex_optimistic_spin(struct mutex *lock,
                 * memory barriers as we'll eventually observe the right
                 * values at the cost of a few extra spins.
                 */
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
 
        if (!waiter)
index 05a37857ab5516012949ca64b31cff3d133c61e7..4ea2710b9d6c17952602c5a25f8d33607f7ce909 100644 (file)
@@ -75,7 +75,7 @@ osq_wait_next(struct optimistic_spin_queue *lock,
                                break;
                }
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
 
        return next;
@@ -122,7 +122,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
                if (need_resched())
                        goto unqueue;
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
        return true;
 
@@ -148,7 +148,7 @@ unqueue:
                if (smp_load_acquire(&node->locked))
                        return true;
 
-               cpu_relax_lowlatency();
+               cpu_relax();
 
                /*
                 * Or we race against a concurrent unqueue()'s step-B, in which
index 19248ddf37cea70b7a0e5cf0f2481fa5061bf8d5..cc3ed0ccdfa28622971ada92668bd3b1e45b4ee0 100644 (file)
@@ -54,7 +54,7 @@ static __always_inline void
 rspin_until_writer_unlock(struct qrwlock *lock, u32 cnts)
 {
        while ((cnts & _QW_WMASK) == _QW_LOCKED) {
-               cpu_relax_lowlatency();
+               cpu_relax();
                cnts = atomic_read_acquire(&lock->cnts);
        }
 }
@@ -130,7 +130,7 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
                   (cmpxchg_relaxed(&l->wmode, 0, _QW_WAITING) == 0))
                        break;
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
 
        /* When no more readers, set the locked flag */
@@ -141,7 +141,7 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
                                            _QW_LOCKED) == _QW_WAITING))
                        break;
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
 unlock:
        arch_spin_unlock(&lock->wait_lock);
index 2337b4bb2366df1c2e21ada2ddb5d4b024aae890..2fa2e2e649507214af0778e74c4168da45fe4579 100644 (file)
@@ -368,7 +368,7 @@ static noinline bool rwsem_spin_on_owner(struct rw_semaphore *sem)
                        return false;
                }
 
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
        rcu_read_unlock();
 out:
@@ -423,7 +423,7 @@ static bool rwsem_optimistic_spin(struct rw_semaphore *sem)
                 * memory barriers as we'll eventually observe the right
                 * values at the cost of a few extra spins.
                 */
-               cpu_relax_lowlatency();
+               cpu_relax();
        }
        osq_unlock(&sem->osq);
 done:
index 5a92189ad711af195f501fce9a3c5e2844ed11a1..c4bfcb8836cdd961761d08ec275616ac80a464b6 100644 (file)
@@ -20,7 +20,7 @@
                if (likely(old.lock_count == prev.lock_count)) {                \
                        SUCCESS;                                                \
                }                                                               \
-               cpu_relax_lowlatency();                                         \
+               cpu_relax();                                                    \
        }                                                                       \
 } while (0)