Skip to content

Commit

Permalink
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

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
  ...
  • Loading branch information
torvalds committed Dec 12, 2016
2 parents 3940cf0 + 11f254d commit 6cdf89b
Show file tree
Hide file tree
Showing 116 changed files with 674 additions and 1,523 deletions.
9 changes: 8 additions & 1 deletion Documentation/virtual/kvm/msr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions arch/alpha/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/alpha/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 0 additions & 18 deletions arch/arc/include/asm/mutex.h

This file was deleted.

3 changes: 0 additions & 3 deletions arch/arc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 0 additions & 21 deletions arch/arm/include/asm/mutex.h

This file was deleted.

2 changes: 0 additions & 2 deletions arch/arm/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions arch/avr32/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/avr32/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion arch/blackfin/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/blackfin/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions arch/c6x/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/c6x/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 0 additions & 9 deletions arch/cris/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/cris/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 0 additions & 9 deletions arch/frv/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/frv/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions arch/h8300/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/h8300/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); \
Expand Down
8 changes: 0 additions & 8 deletions arch/hexagon/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/hexagon/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
90 changes: 0 additions & 90 deletions arch/ia64/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/ia64/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions arch/m32r/include/asm/mutex.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/m32r/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
1 change: 0 additions & 1 deletion arch/m68k/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion arch/metag/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/metag/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion arch/microblaze/include/asm/mutex.h

This file was deleted.

Loading

0 comments on commit 6cdf89b

Please sign in to comment.