projects/linux·commit 6cdf89b1

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

6cdf89b1 · Linus Torvalds <[email protected]> · 2016-12-12 10:48:02 -08:00

Pull locking updates from Ingo Molnar:
 "The tree got pretty big in this development cycle, but the net effect
  is pretty good:

    115 files changed, 673 insertions(+), 1522 deletions(-)

  The main changes were:

   - Rework and generalize the mutex code to remove per arch mutex
     primitives. (Peter Zijlstra)

   - Add vCPU preemption support: add an interface to query the
     preemption status of vCPUs and use it in locking primitives - this
     optimizes paravirt performance. (Pan Xinhui, Juergen Gross,
     Christian Borntraeger)

   - Introduce cpu_relax_yield() and remov cpu_relax_lowlatency() to
     clean up and improve the s390 lock yielding machinery and its core
     kernel impact. (Christian Borntraeger)

   - Micro-optimize mutexes some more. (Waiman Long)

   - Reluctantly add the to-be-deprecated mutex_trylock_recursive()
     interface on a temporary basis, to give the DRM code more time to
     get rid of its locking hacks. Any other users will be NAK-ed on
     sight. (We turned off the deprecation warning for the time being to
     not pollute the build log.) (Peter Zijlstra)

   - Improve the rtmutex code a bit, in light of recent long lived
     bugs/races. (Thomas Gleixner)

   - Misc fixes, cleanups"

* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
  x86/paravirt: Fix bool return type for PVOP_CALL()
  x86/paravirt: Fix native_patch()
  locking/ww_mutex: Use relaxed atomics
  locking/rtmutex: Explain locking rules for rt_mutex_proxy_unlock()/init_proxy_locked()
  locking/rtmutex: Get rid of RT_MUTEX_OWNER_MASKALL
  x86/paravirt: Optimize native pv_lock_ops.vcpu_is_preempted()
  locking/mutex: Break out of expensive busy-loop on {mutex,rwsem}_spin_on_owner() when owner vCPU is preempted
  locking/osq: Break out of spin-wait busy waiting loop for a preempted vCPU in osq_lock()
  Documentation/virtual/kvm: Support the vCPU preemption check
  x86/xen: Support the vCPU preemption check
  x86/kvm: Support the vCPU preemption check
  x86/kvm: Support the vCPU preemption check
  kvm: Introduce kvm_write_guest_offset_cached()
  locking/core, x86/paravirt: Implement vcpu_is_preempted(cpu) for KVM and Xen guests
  locking/spinlocks, s390: Implement vcpu_is_preempted(cpu)
  locking/core, powerpc: Implement vcpu_is_preempted(cpu)
  sched/core: Introduce the vcpu_is_preempted(cpu) interface
  sched/wake_q: Rename WAKE_Q to DEFINE_WAKE_Q
  locking/core: Provide common cpu_relax_yield() definition
  locking/mutex: Don't mark mutex_trylock_recursive() as deprecated, temporarily
  ...
Commit
6cdf89b1ca803b2d2d097466516431b1fc5bf985
Parents
3940cf0b · 11f254db

Merge commit. Changes below are compared with the first parent: 3940cf0b.

Changes

116 files changed · +674 −1523

FileStatusAddDelContent
Documentation/virtual/kvm/msr.txtmodified+8−1View file
arch/alpha/include/asm/mutex.hdeleted+0−9View before deletion
arch/alpha/include/asm/processor.hmodified+0−1View file
arch/arc/include/asm/mutex.hdeleted+0−18View before deletion
arch/arc/include/asm/processor.hmodified+0−3View file
arch/arm/include/asm/mutex.hdeleted+0−21View before deletion
arch/arm/include/asm/processor.hmodified+0−2View file
arch/arm64/include/asm/Kbuildmodified+0−1View file
arch/arm64/include/asm/processor.hmodified+0−2View file
arch/avr32/include/asm/mutex.hdeleted+0−9View before deletion
arch/avr32/include/asm/processor.hmodified+0−1View file
arch/blackfin/include/asm/Kbuildmodified+0−1View file
arch/blackfin/include/asm/processor.hmodified+0−1View file
arch/c6x/include/asm/mutex.hdeleted+0−6View before deletion
arch/c6x/include/asm/processor.hmodified+0−1View file
arch/cris/include/asm/mutex.hdeleted+0−9View before deletion
arch/cris/include/asm/processor.hmodified+0−1View file
arch/frv/include/asm/mutex.hdeleted+0−9View before deletion
arch/frv/include/asm/processor.hmodified+0−1View file
arch/h8300/include/asm/mutex.hdeleted+0−9View before deletion
arch/h8300/include/asm/processor.hmodified+0−1View file
arch/hexagon/include/asm/mutex.hdeleted+0−8View before deletion
arch/hexagon/include/asm/processor.hmodified+0−1View file
arch/ia64/include/asm/mutex.hdeleted+0−90View before deletion
arch/ia64/include/asm/processor.hmodified+0−1View file
arch/m32r/include/asm/mutex.hdeleted+0−9View before deletion
arch/m32r/include/asm/processor.hmodified+0−1View file
arch/m68k/include/asm/Kbuildmodified+0−1View file
arch/m68k/include/asm/processor.hmodified+0−1View file
arch/metag/include/asm/Kbuildmodified+0−1View file
arch/metag/include/asm/processor.hmodified+0−1View file
arch/microblaze/include/asm/mutex.hdeleted+0−1View before deletion
arch/microblaze/include/asm/processor.hmodified+0−1View file
arch/mips/include/asm/Kbuildmodified+0−1View file
arch/mips/include/asm/processor.hmodified+0−1View file
arch/mn10300/include/asm/mutex.hdeleted+0−16View before deletion
arch/mn10300/include/asm/processor.hmodified+0−1View file
arch/nios2/include/asm/mutex.hdeleted+0−1View before deletion
arch/nios2/include/asm/processor.hmodified+0−1View file
arch/openrisc/include/asm/mutex.hdeleted+0−27View before deletion
arch/openrisc/include/asm/processor.hmodified+0−1View file
arch/parisc/include/asm/Kbuildmodified+0−1View file
arch/parisc/include/asm/processor.hmodified+0−1View file
arch/powerpc/include/asm/mutex.hdeleted+0−132View before deletion
arch/powerpc/include/asm/processor.hmodified+0−2View file
arch/powerpc/include/asm/spinlock.hmodified+8−0View file
arch/s390/include/asm/mutex.hdeleted+0−9View before deletion
arch/s390/include/asm/processor.hmodified+3−2View file
arch/s390/include/asm/spinlock.hmodified+8−0View file
arch/s390/kernel/processor.cmodified+2−2View file
arch/s390/kernel/smp.cmodified+7−2View file
arch/s390/lib/spinlock.cmodified+8−17View file
arch/score/include/asm/mutex.hdeleted+0−6View before deletion
arch/score/include/asm/processor.hmodified+0−1View file
arch/sh/include/asm/mutex-llsc.hdeleted+0−109View before deletion
arch/sh/include/asm/mutex.hdeleted+0−12View before deletion
arch/sh/include/asm/processor.hmodified+0−1View file
arch/sparc/include/asm/Kbuildmodified+0−1View file
arch/sparc/include/asm/processor_32.hmodified+0−1View file
arch/sparc/include/asm/processor_64.hmodified+0−1View file
arch/tile/include/asm/Kbuildmodified+0−1View file
arch/tile/include/asm/processor.hmodified+0−2View file
arch/um/include/asm/Kbuildmodified+0−1View file
arch/unicore32/include/asm/mutex.hdeleted+0−20View before deletion
arch/unicore32/include/asm/processor.hmodified+0−1View file
arch/x86/include/asm/mutex.hdeleted+0−5View before deletion
arch/x86/include/asm/mutex_32.hdeleted+0−110View before deletion
arch/x86/include/asm/mutex_64.hdeleted+0−127View before deletion
arch/x86/include/asm/paravirt.hmodified+5−0View file
arch/x86/include/asm/paravirt_types.hmodified+15−1View file
arch/x86/include/asm/processor.hmodified+0−2View file
arch/x86/include/asm/qspinlock.hmodified+6−0View file
arch/x86/include/uapi/asm/kvm_para.hmodified+3−1View file
arch/x86/kernel/kvm.cmodified+13−0View file
arch/x86/kernel/paravirt-spinlocks.cmodified+13−1View file
arch/x86/kernel/paravirt_patch_32.cmodified+12−0View file
arch/x86/kernel/paravirt_patch_64.cmodified+12−0View file
arch/x86/kvm/x86.cmodified+16−0View file
arch/x86/um/asm/processor.hmodified+0−1View file
arch/x86/xen/spinlock.cmodified+2−0View file
arch/xtensa/include/asm/mutex.hdeleted+0−9View before deletion
arch/xtensa/include/asm/processor.hmodified+0−1View file
drivers/gpu/drm/i915/i915_gem_request.cmodified+1−1View file
drivers/gpu/drm/i915/i915_gem_shrinker.cmodified+11−19View file
drivers/gpu/drm/msm/msm_gem_shrinker.cmodified+9−18View file
drivers/vhost/net.cmodified+2−2View file
include/asm-generic/mutex-dec.hdeleted+0−88View before deletion
include/asm-generic/mutex-null.hdeleted+0−19View before deletion
include/asm-generic/mutex-xchg.hdeleted+0−120View before deletion
include/asm-generic/mutex.hdeleted+0−9View before deletion
include/linux/kvm_host.hmodified+2−0View file
include/linux/mutex-debug.hdeleted+0−24View before deletion
include/linux/mutex.hmodified+61−16View file
include/linux/sched.hmodified+18−2View file
include/linux/ww_mutex.hmodified+1−1View file
ipc/mqueue.cmodified+2−2View file
ipc/msg.cmodified+4−4View file
kernel/Kconfig.locksmodified+1−1View file
kernel/futex.cmodified+4−4View file
kernel/locking/lockdep.cmodified+5−5View file
kernel/locking/mcs_spinlock.hmodified+2−2View file
kernel/locking/mutex-debug.cmodified+0−13View file
kernel/locking/mutex-debug.hmodified+0−10View file
kernel/locking/mutex.cmodified+340−248View file
kernel/locking/mutex.hmodified+0−26View file
kernel/locking/osq_lock.cmodified+11−4View file
kernel/locking/qrwlock.cmodified+3−3View file
kernel/locking/rtmutex.cmodified+13−5View file
kernel/locking/rtmutex_common.hmodified+1−2View file
kernel/locking/rwsem-xadd.cmodified+18−10View file
kernel/sched/core.cmodified+1−1View file
kernel/stop_machine.cmodified+1−1View file
lib/lockref.cmodified+1−1View file
net/core/dev.cmodified+1−1View file
scripts/checkpatch.plmodified+6−0View file
virt/kvm/kvm_main.cmodified+14−6View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/virtual/kvm/msr.txt

View file
diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/virtual/kvm/msr.txt
index 2a71c8f..0a9ea51 100644
--- a/Documentation/virtual/kvm/msr.txt
+++ b/Documentation/virtual/kvm/msr.txt
@@ -208,7 +208,9 @@ MSR_KVM_STEAL_TIME: 0x4b564d03
__u64 steal;
__u32 version;
__u32 flags;
- __u32 pad[12];
+ __u8 preempted;
+ __u8 u8_pad[3];
+ __u32 pad[11];
}
whose data will be filled in by the hypervisor periodically. Only one
@@ -232,6 +234,11 @@ MSR_KVM_STEAL_TIME: 0x4b564d03
nanoseconds. Time during which the vcpu is idle, will not be
reported as steal time.
+ preempted: indicate the vCPU who owns this struct is running or
+ not. Non-zero values mean the vCPU has been preempted. Zero
+ means the vCPU is not preempted. NOTE, it is always zero if the
+ the hypervisor doesn't support this field.
+
MSR_KVM_EOI_EN: 0x4b564d04
data: Bit 0 is 1 when PV end of interrupt is enabled on the vcpu; 0
when disabled. Bit 1 is reserved and must be zero. When PV end of

arch/alpha/include/asm/mutex.h

View before deletion
diff --git a/arch/alpha/include/asm/mutex.h b/arch/alpha/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/alpha/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/alpha/include/asm/processor.h

View file
diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h
index 43a7559..2fec2de 100644
--- a/arch/alpha/include/asm/processor.h
+++ b/arch/alpha/include/asm/processor.h
@@ -58,7 +58,6 @@ unsigned long get_wchan(struct task_struct *p);
((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#define ARCH_HAS_PREFETCH
#define ARCH_HAS_PREFETCHW

arch/arc/include/asm/mutex.h

View before deletion
diff --git a/arch/arc/include/asm/mutex.h b/arch/arc/include/asm/mutex.h
deleted file mode 100644
index a2f88ff..0000000
--- a/arch/arc/include/asm/mutex.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/*
- * xchg() based mutex fast path maintains a state of 0 or 1, as opposed to
- * atomic dec based which can "count" any number of lock contenders.
- * This ideally needs to be fixed in core, but for now switching to dec ver.
- */
-#if defined(CONFIG_SMP) && (CONFIG_NR_CPUS > 2)
-#include <asm-generic/mutex-dec.h>
-#else
-#include <asm-generic/mutex-xchg.h>
-#endif

arch/arc/include/asm/processor.h

View file
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
index 16b630f..6e1242d 100644
--- a/arch/arc/include/asm/processor.h
+++ b/arch/arc/include/asm/processor.h
@@ -60,15 +60,12 @@ struct task_struct;
#ifndef CONFIG_EZNPS_MTM_EXT
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#else
#define cpu_relax() \
__asm__ __volatile__ (".word %0" : : "i"(CTOP_INST_SCHD_RW) : "memory")
-#define cpu_relax_lowlatency() barrier()
-
#endif
#define copy_segments(tsk, mm) do { } while (0)

arch/arm/include/asm/mutex.h

View before deletion
diff --git a/arch/arm/include/asm/mutex.h b/arch/arm/include/asm/mutex.h
deleted file mode 100644
index 87c0449..0000000
--- a/arch/arm/include/asm/mutex.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * arch/arm/include/asm/mutex.h
- *
- * ARM optimized mutex locking primitives
- *
- * Please look into asm-generic/mutex-xchg.h for a formal definition.
- */
-#ifndef _ASM_MUTEX_H
-#define _ASM_MUTEX_H
-/*
- * On pre-ARMv6 hardware this results in a swp-based implementation,
- * which is the most efficient. For ARMv6+, we have exclusive memory
- * accessors and use atomic_dec to avoid the extra xchg operations
- * on the locking slowpaths.
- */
-#if __LINUX_ARM_ARCH__ < 6
-#include <asm-generic/mutex-xchg.h>
-#else
-#include <asm-generic/mutex-dec.h>
-#endif
-#endif /* _ASM_MUTEX_H */

arch/arm/include/asm/processor.h

View file
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index 8a1e8e9..c3d5fc1 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -82,8 +82,6 @@ unsigned long get_wchan(struct task_struct *p);
#define cpu_relax() barrier()
#endif
-#define cpu_relax_lowlatency() cpu_relax()
-
#define task_pt_regs(p) \
((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)

arch/arm64/include/asm/Kbuild

View file
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index 44e1d7f..b4ab238 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -24,7 +24,6 @@ generic-y += mm-arch-hooks.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += msi.h
-generic-y += mutex.h
generic-y += poll.h
generic-y += preempt.h
generic-y += resource.h

arch/arm64/include/asm/processor.h

View file
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 60e3482..747c65a 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -149,8 +149,6 @@ static inline void cpu_relax(void)
asm volatile("yield" ::: "memory");
}
-#define cpu_relax_lowlatency() cpu_relax()
-
/* Thread switching */
extern struct task_struct *cpu_switch_to(struct task_struct *prev,
struct task_struct *next);

arch/avr32/include/asm/mutex.h

View before deletion
diff --git a/arch/avr32/include/asm/mutex.h b/arch/avr32/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/avr32/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/avr32/include/asm/processor.h

View file
diff --git a/arch/avr32/include/asm/processor.h b/arch/avr32/include/asm/processor.h
index 941593c..972adcc 100644
--- a/arch/avr32/include/asm/processor.h
+++ b/arch/avr32/include/asm/processor.h
@@ -92,7 +92,6 @@ extern struct avr32_cpuinfo boot_cpu_data;
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#define cpu_sync_pipeline() asm volatile("sub pc, -2" : : : "memory")
struct cpu_context {

arch/blackfin/include/asm/Kbuild

View file
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild
index 91d49c0..2fb67b5 100644
--- a/arch/blackfin/include/asm/Kbuild
+++ b/arch/blackfin/include/asm/Kbuild
@@ -24,7 +24,6 @@ generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += mman.h
generic-y += msgbuf.h
-generic-y += mutex.h
generic-y += param.h
generic-y += percpu.h
generic-y += pgalloc.h

arch/blackfin/include/asm/processor.h

View file
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index 0c265ab..85d4af9 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -92,7 +92,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
#define cpu_relax() smp_mb()
-#define cpu_relax_lowlatency() cpu_relax()
/* Get the Silicon Revision of the chip */
static inline uint32_t __pure bfin_revid(void)

arch/c6x/include/asm/mutex.h

View before deletion
diff --git a/arch/c6x/include/asm/mutex.h b/arch/c6x/include/asm/mutex.h
deleted file mode 100644
index 7a7248e..0000000
--- a/arch/c6x/include/asm/mutex.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_C6X_MUTEX_H
-#define _ASM_C6X_MUTEX_H
-
-#include <asm-generic/mutex-null.h>
-
-#endif /* _ASM_C6X_MUTEX_H */

arch/c6x/include/asm/processor.h

View file
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
index f2ef31b..b9eb3da 100644
--- a/arch/c6x/include/asm/processor.h
+++ b/arch/c6x/include/asm/processor.h
@@ -121,7 +121,6 @@ extern unsigned long get_wchan(struct task_struct *p);
#define KSTK_ESP(task) (task_pt_regs(task)->sp)
#define cpu_relax() do { } while (0)
-#define cpu_relax_lowlatency() cpu_relax()
extern const struct seq_operations cpuinfo_op;

arch/cris/include/asm/mutex.h

View before deletion
diff --git a/arch/cris/include/asm/mutex.h b/arch/cris/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/cris/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/cris/include/asm/processor.h

View file
diff --git a/arch/cris/include/asm/processor.h b/arch/cris/include/asm/processor.h
index 862126b..15b815d 100644
--- a/arch/cris/include/asm/processor.h
+++ b/arch/cris/include/asm/processor.h
@@ -63,7 +63,6 @@ static inline void release_thread(struct task_struct *dead_task)
#define init_stack (init_thread_union.stack)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
void default_idle(void);

arch/frv/include/asm/mutex.h

View before deletion
diff --git a/arch/frv/include/asm/mutex.h b/arch/frv/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/frv/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/frv/include/asm/processor.h

View file
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h
index 73f0a79..ddaeb9c 100644
--- a/arch/frv/include/asm/processor.h
+++ b/arch/frv/include/asm/processor.h
@@ -107,7 +107,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
/* data cache prefetch */
#define ARCH_HAS_PREFETCH

arch/h8300/include/asm/mutex.h

View before deletion
diff --git a/arch/h8300/include/asm/mutex.h b/arch/h8300/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/h8300/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/h8300/include/asm/processor.h

View file
diff --git a/arch/h8300/include/asm/processor.h b/arch/h8300/include/asm/processor.h
index 111df73..65132d7 100644
--- a/arch/h8300/include/asm/processor.h
+++ b/arch/h8300/include/asm/processor.h
@@ -127,7 +127,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#define HARD_RESET_NOW() ({ \
local_irq_disable(); \

arch/hexagon/include/asm/mutex.h

View before deletion
diff --git a/arch/hexagon/include/asm/mutex.h b/arch/hexagon/include/asm/mutex.h
deleted file mode 100644
index 58b52de..0000000
--- a/arch/hexagon/include/asm/mutex.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-#include <asm-generic/mutex-xchg.h>

arch/hexagon/include/asm/processor.h

View file
diff --git a/arch/hexagon/include/asm/processor.h b/arch/hexagon/include/asm/processor.h
index d850113..45a8254 100644
--- a/arch/hexagon/include/asm/processor.h
+++ b/arch/hexagon/include/asm/processor.h
@@ -56,7 +56,6 @@ struct thread_struct {
}
#define cpu_relax() __vmyield()
-#define cpu_relax_lowlatency() cpu_relax()
/*
* Decides where the kernel will search for a free chunk of vm space during

arch/ia64/include/asm/mutex.h

View before deletion
diff --git a/arch/ia64/include/asm/mutex.h b/arch/ia64/include/asm/mutex.h
deleted file mode 100644
index 28cb819..0000000
--- a/arch/ia64/include/asm/mutex.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * ia64 implementation of the mutex fastpath.
- *
- * Copyright (C) 2006 Ken Chen <[email protected]>
- *
- */
-
-#ifndef _ASM_MUTEX_H
-#define _ASM_MUTEX_H
-
-/**
- * __mutex_fastpath_lock - try to take the lock by moving the count
- * from 1 to a 0 value
- * @count: pointer of type atomic_t
- * @fail_fn: function to call if the original value was not 1
- *
- * Change the count from 1 to a value lower than 1, and call <fail_fn> if
- * it wasn't 1 originally. This function MUST leave the value lower than
- * 1 even when the "1" assertion wasn't true.
- */
-static inline void
-__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
- if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
- fail_fn(count);
-}
-
-/**
- * __mutex_fastpath_lock_retval - try to take the lock by moving the count
- * from 1 to a 0 value
- * @count: pointer of type atomic_t
- *
- * Change the count from 1 to a value lower than 1. This function returns 0
- * if the fastpath succeeds, or -1 otherwise.
- */
-static inline int
-__mutex_fastpath_lock_retval(atomic_t *count)
-{
- if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
- return -1;
- return 0;
-}
-
-/**
- * __mutex_fastpath_unlock - try to promote the count from 0 to 1
- * @count: pointer of type atomic_t
- * @fail_fn: function to call if the original value was not 0
- *
- * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
- * In the failure case, this function is allowed to either set the value to
- * 1, or to set it to a value lower than 1.
- *
- * If the implementation sets it to a value of lower than 1, then the
- * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
- * to return 0 otherwise.
- */
-static inline void
-__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
-{
- int ret = ia64_fetchadd4_rel(count, 1);
- if (unlikely(ret < 0))
- fail_fn(count);
-}
-
-#define __mutex_slowpath_needs_to_unlock() 1
-
-/**
- * __mutex_fastpath_trylock - try to acquire the mutex, without waiting
- *
- * @count: pointer of type atomic_t
- * @fail_fn: fallback function
- *
- * Change the count from 1 to a value lower than 1, and return 0 (failure)
- * if it wasn't 1 originally, or return 1 (success) otherwise. This function
- * MUST leave the value lower than 1 even when the "1" assertion wasn't true.
- * Additionally, if the value was < 0 originally, this function must not leave
- * it to 0 on failure.
- *
- * If the architecture has no effective trylock variant, it should call the
- * <fail_fn> spinlock-based trylock variant unconditionally.
- */
-static inline int
-__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
-{
- if (atomic_read(count) == 1 && cmpxchg_acq(count, 1, 0) == 1)
- return 1;
- return 0;
-}
-
-#endif

arch/ia64/include/asm/processor.h

View file
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index ce53c50..03911a3 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -547,7 +547,6 @@ ia64_eoi (void)
}
#define cpu_relax() ia64_hint(ia64_hint_pause)
-#define cpu_relax_lowlatency() cpu_relax()
static inline int
ia64_get_irr(unsigned int vector)

arch/m32r/include/asm/mutex.h

View before deletion
diff --git a/arch/m32r/include/asm/mutex.h b/arch/m32r/include/asm/mutex.h
deleted file mode 100644
index 458c1f7..0000000
--- a/arch/m32r/include/asm/mutex.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>

arch/m32r/include/asm/processor.h

View file
diff --git a/arch/m32r/include/asm/processor.h b/arch/m32r/include/asm/processor.h
index 9f8fd9b..5767367 100644
--- a/arch/m32r/include/asm/processor.h
+++ b/arch/m32r/include/asm/processor.h
@@ -133,6 +133,5 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_ESP(tsk) ((tsk)->thread.sp)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#endif /* _ASM_M32R_PROCESSOR_H */

arch/m68k/include/asm/Kbuild

View file
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index eb85bd9..1f2e5d3 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -20,7 +20,6 @@ generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += mman.h
-generic-y += mutex.h
generic-y += percpu.h
generic-y += preempt.h
generic-y += resource.h

arch/m68k/include/asm/processor.h

View file
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index c84a218..f5f790c 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -156,6 +156,5 @@ unsigned long get_wchan(struct task_struct *p);
#define task_pt_regs(tsk) ((struct pt_regs *) ((tsk)->thread.esp0))
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
#endif

arch/metag/include/asm/Kbuild

View file
diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild
index 29acb89..167150c 100644
--- a/arch/metag/include/asm/Kbuild
+++ b/arch/metag/include/asm/Kbuild
@@ -27,7 +27,6 @@ generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
generic-y += msgbuf.h
-generic-y += mutex.h
generic-y += param.h
generic-y += pci.h
generic-y += percpu.h

arch/metag/include/asm/processor.h

View file
diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h
index a0333eb..ec6a490 100644
--- a/arch/metag/include/asm/processor.h
+++ b/arch/metag/include/asm/processor.h
@@ -152,7 +152,6 @@ unsigned long get_wchan(struct task_struct *p);
#define user_stack_pointer(regs) ((regs)->ctx.AX[0].U0)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
extern void setup_priv(void);

arch/microblaze/include/asm/mutex.h

View before deletion
diff --git a/arch/microblaze/include/asm/mutex.h b/arch/microblaze/include/asm/mutex.h
deleted file mode 100644
index ff6101a..0000000
--- a/arch/microblaze/include/asm/mutex.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/mutex-dec.h>

arch/microblaze/include/asm/processor.h

View file
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index c38d0dd..37ef196 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -22,7 +22,6 @@
extern const struct seq_operations cpuinfo_op;
# define cpu_relax() barrier()
-# define cpu_relax_lowlatency() cpu_relax()
#define task_pt_regs(tsk) \
(((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)

arch/mips/include/asm/Kbuild

View file
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 9740066..3269b74 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -9,7 +9,6 @@ generic-y += irq_work.h
generic-y += local64.h
generic-y += mcs_spinlock.h
generic-y += mm-arch-hooks.h
-generic-y += mutex.h
generic-y += parport.h
generic-y += percpu.h
generic-y += preempt.h

arch/mips/include/asm/processor.h

View file
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index 0d36c87..95b8c47 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -389,7 +389,6 @@ unsigned long get_wchan(struct task_struct *p);
#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()
/*
* Return_address is a replacement for __builtin_return_address(count)

arch/mn10300/include/asm/mutex.h

View before deletion
diff --git a/arch/mn10300/include/asm/mutex.h b/arch/mn10300/include/asm/mutex.h
deleted file mode 100644
index 84f5490..0000000
--- a/arch/mn10300/include/asm/mutex.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* MN10300 Mutex fastpath
- *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells ([email protected])
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- *
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-#include <asm-generic/mutex-null.h>

arch/mn10300/include/asm/processor.h

View file
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h
index b10ba12..18e17ab 100644
--- a/arch/mn10300/include/asm/processor.h
+++ b/arch/mn10300/include/asm/processor.h
@@ -69,7 +69,6 @@ extern void print_cpu_info(struct mn10300_cpuinfo *);
extern void dodgy_tsc(void);
#define cpu_relax() barrier()
-#define cpu_relax_lowlatency() cpu_relax()

This diff is incomplete. Download the complete patch.

arch/nios2/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/nios2/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/openrisc/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/openrisc/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/parisc/include/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/parisc/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/spinlock.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/spinlock.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/processor.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/lib/spinlock.c

View file

This diff is incomplete. Download the complete patch.

arch/score/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/score/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/sh/include/asm/mutex-llsc.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sh/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sh/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/processor_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/processor_64.h

View file

This diff is incomplete. Download the complete patch.

arch/tile/include/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/tile/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/um/include/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/unicore32/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/unicore32/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/mutex_32.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/mutex_64.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/paravirt.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/paravirt_types.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/qspinlock.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/uapi/asm/kvm_para.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/kvm.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/paravirt-spinlocks.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/paravirt_patch_32.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/paravirt_patch_64.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kvm/x86.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/um/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/xen/spinlock.c

View file

This diff is incomplete. Download the complete patch.

arch/xtensa/include/asm/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/xtensa/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/i915/i915_gem_request.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/i915/i915_gem_shrinker.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/msm/msm_gem_shrinker.c

View file

This diff is incomplete. Download the complete patch.

drivers/vhost/net.c

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/mutex-dec.h

View before deletion

This diff is incomplete. Download the complete patch.

include/asm-generic/mutex-null.h

View before deletion

This diff is incomplete. Download the complete patch.

include/asm-generic/mutex-xchg.h

View before deletion

This diff is incomplete. Download the complete patch.

include/asm-generic/mutex.h

View before deletion

This diff is incomplete. Download the complete patch.

include/linux/kvm_host.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mutex-debug.h

View before deletion

This diff is incomplete. Download the complete patch.

include/linux/mutex.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched.h

View file

This diff is incomplete. Download the complete patch.

include/linux/ww_mutex.h

View file

This diff is incomplete. Download the complete patch.

ipc/mqueue.c

View file

This diff is incomplete. Download the complete patch.

ipc/msg.c

View file

This diff is incomplete. Download the complete patch.

kernel/Kconfig.locks

View file

This diff is incomplete. Download the complete patch.

kernel/futex.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/lockdep.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/mcs_spinlock.h

View file

This diff is incomplete. Download the complete patch.

kernel/locking/mutex-debug.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/mutex-debug.h

View file

This diff is incomplete. Download the complete patch.

kernel/locking/mutex.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/mutex.h

View file

This diff is incomplete. Download the complete patch.

kernel/locking/osq_lock.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/qrwlock.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/rtmutex.c

View file

This diff is incomplete. Download the complete patch.

kernel/locking/rtmutex_common.h

View file

This diff is incomplete. Download the complete patch.

kernel/locking/rwsem-xadd.c

View file

This diff is incomplete. Download the complete patch.

kernel/sched/core.c

View file

This diff is incomplete. Download the complete patch.

kernel/stop_machine.c

View file

This diff is incomplete. Download the complete patch.

lib/lockref.c

View file

This diff is incomplete. Download the complete patch.

net/core/dev.c

View file

This diff is incomplete. Download the complete patch.

scripts/checkpatch.pl

View file

This diff is incomplete. Download the complete patch.

virt/kvm/kvm_main.c

View file

This diff is incomplete. Download the complete patch.