]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
locking/core: Provide common cpu_relax_yield() definition
authorChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 16 Nov 2016 12:23:05 +0000 (13:23 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 17 Nov 2016 07:17:36 +0000 (08:17 +0100)
No need to duplicate the same define everywhere. Since
the only user is stop-machine and the only provider is
s390, we can use a default implementation of cpu_relax_yield()
in sched.h.

Suggested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.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: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: kvm@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-s390 <linux-s390@vger.kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: sparclinux@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/1479298985-191589-1-git-send-email-borntraeger@de.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
33 files changed:
arch/alpha/include/asm/processor.h
arch/arc/include/asm/processor.h
arch/arm/include/asm/processor.h
arch/arm64/include/asm/processor.h
arch/avr32/include/asm/processor.h
arch/blackfin/include/asm/processor.h
arch/c6x/include/asm/processor.h
arch/cris/include/asm/processor.h
arch/frv/include/asm/processor.h
arch/h8300/include/asm/processor.h
arch/hexagon/include/asm/processor.h
arch/ia64/include/asm/processor.h
arch/m32r/include/asm/processor.h
arch/m68k/include/asm/processor.h
arch/metag/include/asm/processor.h
arch/microblaze/include/asm/processor.h
arch/mips/include/asm/processor.h
arch/mn10300/include/asm/processor.h
arch/nios2/include/asm/processor.h
arch/openrisc/include/asm/processor.h
arch/parisc/include/asm/processor.h
arch/powerpc/include/asm/processor.h
arch/s390/include/asm/processor.h
arch/score/include/asm/processor.h
arch/sh/include/asm/processor.h
arch/sparc/include/asm/processor_32.h
arch/sparc/include/asm/processor_64.h
arch/tile/include/asm/processor.h
arch/unicore32/include/asm/processor.h
arch/x86/include/asm/processor.h
arch/x86/um/asm/processor.h
arch/xtensa/include/asm/processor.h
include/linux/sched.h

index 31e8dbeef10bfe4b14d80d4ca0bda898ff0161b0..2fec2dee3020ba5047e672aa69ce5fc4516b8d3f 100644 (file)
@@ -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_yield() cpu_relax()
 
 #define ARCH_HAS_PREFETCH
 #define ARCH_HAS_PREFETCHW
index d102a49ad8c5c2bdc7b0f6c49bb3cb6274a8c90e..6e1242da0159e274b7e161f9648e031cbddd7ef4 100644 (file)
@@ -60,15 +60,12 @@ struct task_struct;
 #ifndef CONFIG_EZNPS_MTM_EXT
 
 #define cpu_relax()            barrier()
-#define cpu_relax_yield()      cpu_relax()
 
 #else
 
 #define cpu_relax()     \
        __asm__ __volatile__ (".word %0" : : "i"(CTOP_INST_SCHD_RW) : "memory")
 
-#define cpu_relax_yield()      cpu_relax()
-
 #endif
 
 #define copy_segments(tsk, mm)      do { } while (0)
index 9e71c58bfa6fb3d543f5fcd6199317d90869ce5b..c3d5fc124a054c6309ffacdb2845ff22fd5bfa56 100644 (file)
@@ -82,8 +82,6 @@ unsigned long get_wchan(struct task_struct *p);
 #define cpu_relax()                    barrier()
 #endif
 
-#define cpu_relax_yield()                    cpu_relax()
-
 #define task_pt_regs(p) \
        ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
 
index 6132f64af68dde433772299e3b564bdbb2953794..747c65a616ed5b75ccb66fae36c2389e148d5361 100644 (file)
@@ -149,8 +149,6 @@ static inline void cpu_relax(void)
        asm volatile("yield" ::: "memory");
 }
 
-#define cpu_relax_yield()                     cpu_relax()
-
 /* Thread switching */
 extern struct task_struct *cpu_switch_to(struct task_struct *prev,
                                         struct task_struct *next);
index ee62365ad0da3fcef387d1ebeffe30ca79b1cab9..972adcc1e8f40179d06a4062d2adf63416f36452 100644 (file)
@@ -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_yield()      cpu_relax()
 #define cpu_sync_pipeline()    asm volatile("sub pc, -2" : : : "memory")
 
 struct cpu_context {
index 57acfb1acfe5d48538c938dd9feff46da1518925..85d4af97c986aee4a7eff90b4347aca444ee1ed9 100644 (file)
@@ -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_yield()      cpu_relax()
 
 /* Get the Silicon Revision of the chip */
 static inline uint32_t __pure bfin_revid(void)
index 1fd22e727e44f3dd065e832fab63a81c50a128f7..b9eb3da7f278dac858bfb2191094f9fc837ac5c8 100644 (file)
@@ -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_yield()             cpu_relax()
 
 extern const struct seq_operations cpuinfo_op;
 
index 1a578417397ff76ed357ad2293036e87614fcff4..15b815df29c165809c4e6e229ede6a077d9e8e71 100644 (file)
@@ -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_yield() cpu_relax()
 
 void default_idle(void);
 
index c1e5f2a0ca318431eac8628adfde6a9a8ea3430a..ddaeb9cc9143333d8f00de60291298f6dce5530c 100644 (file)
@@ -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_yield() cpu_relax()
 
 /* data cache prefetch */
 #define ARCH_HAS_PREFETCH
index 42d6053692174cf0d1e30e83f5c432c75221e804..65132d7ae9e5b66fb484014f7930fd91f75cc944 100644 (file)
@@ -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_yield() cpu_relax()
 
 #define HARD_RESET_NOW() ({            \
        local_irq_disable();            \
index 5d694cccc85a84d3307ea89fe8f23ccdbe1ce579..45a825402f634ee4b650a08a60efc5c60d50e261 100644 (file)
@@ -56,7 +56,6 @@ struct thread_struct {
 }
 
 #define cpu_relax() __vmyield()
-#define cpu_relax_yield() cpu_relax()
 
 /*
  * Decides where the kernel will search for a free chunk of vm space during
index 0c2c3b256f6c0f1328d7ddc3094442e16c5ce0e1..03911a3364068585b6868f316abb8a52b8edd8ef 100644 (file)
@@ -547,7 +547,6 @@ ia64_eoi (void)
 }
 
 #define cpu_relax()    ia64_hint(ia64_hint_pause)
-#define cpu_relax_yield() cpu_relax()
 
 static inline int
 ia64_get_irr(unsigned int vector)
index 9b83a13290fc3bf37e8044f7c448231f30879dfa..5767367550c69637a0b51c7a037b7a5e0c4fbfb4 100644 (file)
@@ -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_yield() cpu_relax()
 
 #endif /* _ASM_M32R_PROCESSOR_H */
index b0d044224ce5129f22a7788abd7f3815ca9db590..f5f790c31bf809ac0f89f808614f34b557ca9df6 100644 (file)
@@ -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_yield() cpu_relax()
 
 #endif
index ee302a637f24d95b6213ff5e0859ba88f20d3af2..ec6a49076980fff90dc04ece4b389ea1782449b9 100644 (file)
@@ -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_yield() cpu_relax()
 
 extern void setup_priv(void);
 
index 08ec1f725b7fad7b35eb23a032cd0074f515004b..37ef196e45191adb481450c8648e9e9acbb05106 100644 (file)
@@ -22,7 +22,6 @@
 extern const struct seq_operations cpuinfo_op;
 
 # define cpu_relax()           barrier()
-# define cpu_relax_yield() cpu_relax()
 
 #define task_pt_regs(tsk) \
                (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
index 8ea95e77ec9d7981595d0b0b66bc15991a784d89..95b8c471f572b07d8d313fbadc96d5f1b71a035a 100644 (file)
@@ -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_yield() cpu_relax()
 
 /*
  * Return_address is a replacement for __builtin_return_address(count)
index d11397bc9429587ff5fb28644d7c4d7d7d76d817..18e17abf7664e51c807e3d5649b0585bfd89a3be 100644 (file)
@@ -69,7 +69,6 @@ extern void print_cpu_info(struct mn10300_cpuinfo *);
 extern void dodgy_tsc(void);
 
 #define cpu_relax() barrier()
-#define cpu_relax_yield() cpu_relax()
 
 /*
  * User space process size: 1.75GB (default).
index d32c17669123a7e9c24a85ab4141b2595d36de5e..3bbbc3d798e5f4738548690eb8511834050baa76 100644 (file)
@@ -88,7 +88,6 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)  ((tsk)->thread.kregs->sp)
 
 #define cpu_relax()    barrier()
-#define cpu_relax_yield() cpu_relax()
 
 #endif /* __ASSEMBLY__ */
 
index 7f47fc7b7eaed7cbedd14bd9f0fb0dd4ac3713ae..a908e6c30a001e14860fe70f174f1451c6e4ae09 100644 (file)
@@ -92,7 +92,6 @@ extern unsigned long thread_saved_pc(struct task_struct *t);
 #define init_stack      (init_thread_union.stack)
 
 #define cpu_relax()     barrier()
-#define cpu_relax_yield() cpu_relax()
 
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_OPENRISC_PROCESSOR_H */
index a4a07f4f7c20ab7727193836e42217b8e6c01e50..ca40741378be76c70ecf718a7240e0b96c316530 100644 (file)
@@ -309,7 +309,6 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)  ((tsk)->thread.regs.gr[30])
 
 #define cpu_relax()    barrier()
-#define cpu_relax_yield() cpu_relax()
 
 /*
  * parisc_requires_coherency() is used to identify the combined VIPT/PIPT
index 5684e68724737546cc5acd28d46556848ae35d57..dac83fcb9445128d9dd2d142e9915d68ffc47859 100644 (file)
@@ -404,8 +404,6 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
 #define cpu_relax()    barrier()
 #endif
 
-#define cpu_relax_yield() cpu_relax()
-
 /* Check that a certain kernel stack pointer is valid in task_struct p */
 int validate_sp(unsigned long sp, struct task_struct *p,
                        unsigned long nbytes);
index 9e32f25bdea335b1c57f5e87530d19f210b17196..9d3a21aedc97170377c1111d5bfb41122b8fe7a4 100644 (file)
@@ -234,6 +234,7 @@ static inline unsigned short stap(void)
 /*
  * Give up the time slice of the virtual PU.
  */
+#define cpu_relax_yield cpu_relax_yield
 void cpu_relax_yield(void);
 
 #define cpu_relax() barrier()
index a1e97c063ed49aae91619708e9592abb99d3020e..d9a922d8711b2155a2225699e5958236dbb70adb 100644 (file)
@@ -24,7 +24,6 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define current_text_addr() ({ __label__ _l; _l: &&_l; })
 
 #define cpu_relax()            barrier()
-#define cpu_relax_yield()      cpu_relax()
 #define release_thread(thread) do {} while (0)
 
 /*
index 9454ff1ad0d99947a5fd8d26d78663625481b031..5addd69f70efeaa5257cae64df2bfb8bf8aa3b43 100644 (file)
@@ -97,7 +97,6 @@ extern struct sh_cpuinfo cpu_data[];
 
 #define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
 #define cpu_relax()    barrier()
-#define cpu_relax_yield() cpu_relax()
 
 void default_idle(void);
 void stop_this_cpu(void *);
index fc32b731148163ff7b90da48d55068cc5e1ab0e8..365d4cb267b4397c8a108eaff279be292c4e52e5 100644 (file)
@@ -119,7 +119,6 @@ extern struct task_struct *last_task_used_math;
 int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);
 
 #define cpu_relax()    barrier()
-#define cpu_relax_yield() cpu_relax()
 
 extern void (*sparc_idle)(void);
 
index 12787dfeb11caec294d549802c26266d901bbc63..6448cfc8292f72d329704c92c993e7864ee6ae3d 100644 (file)
@@ -216,7 +216,6 @@ unsigned long get_wchan(struct task_struct *task);
                                     "nop\n\t"                          \
                                     ".previous"                        \
                                     ::: "memory")
-#define cpu_relax_yield() cpu_relax()
 
 /* Prefetch support.  This is tuned for UltraSPARC-III and later.
  * UltraSPARC-I will treat these as nops, and UltraSPARC-II has
index c1c228b16f7fafec7bcbb1e6cef1346e4355c619..0bc9968b97a19296a48d4dfb215cd3464b69f9a6 100644 (file)
@@ -264,8 +264,6 @@ static inline void cpu_relax(void)
        barrier();
 }
 
-#define cpu_relax_yield() cpu_relax()
-
 /* Info on this processor (see fs/proc/cpuinfo.c) */
 struct seq_operations;
 extern const struct seq_operations cpuinfo_op;
index eeefe7c529eb30227ca077966c6a0ebaebcf7768..4eaa4216766772055849a3ffdb1b6e20d30edecb 100644 (file)
@@ -71,7 +71,6 @@ extern void release_thread(struct task_struct *);
 unsigned long get_wchan(struct task_struct *p);
 
 #define cpu_relax()                    barrier()
-#define cpu_relax_yield()              cpu_relax()
 
 #define task_pt_regs(p) \
        ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
index 7513c996f673c0d8fd5908e307c8bd642e37b0ff..c84605bb2a15d089502d0214d5625d463bd69d7b 100644 (file)
@@ -588,8 +588,6 @@ static __always_inline void cpu_relax(void)
        rep_nop();
 }
 
-#define cpu_relax_yield() cpu_relax()
-
 /* Stop speculative execution and prefetching of modified code. */
 static inline void sync_core(void)
 {
index b4bd63b22b7fe5a7b41ba861f39cb15658c977d5..c77db228898225d02e72d524e656a4e20a1d8aa0 100644 (file)
@@ -26,7 +26,6 @@ static inline void rep_nop(void)
 }
 
 #define cpu_relax()            rep_nop()
-#define cpu_relax_yield()      cpu_relax()
 
 #define task_pt_regs(t) (&(t)->thread.regs)
 
index 7d8d6bececfcc2d3d2adf1b1ee26ac4207043f09..86ffcd68e49616e62d693bad4cae85ffbae0582e 100644 (file)
@@ -206,7 +206,6 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)          (task_pt_regs(tsk)->areg[1])
 
 #define cpu_relax()  barrier()
-#define cpu_relax_yield() cpu_relax()
 
 /* Special register access. */
 
index 348f51b0ec92ed02e72a2060eedb03f37cd0995f..c1aa3b02f6ac470d6ddc29f020f4a1cf63f59cd1 100644 (file)
@@ -2444,6 +2444,10 @@ static inline void calc_load_enter_idle(void) { }
 static inline void calc_load_exit_idle(void) { }
 #endif /* CONFIG_NO_HZ_COMMON */
 
+#ifndef cpu_relax_yield
+#define cpu_relax_yield() cpu_relax()
+#endif
+
 /*
  * Do not use outside of architecture code which knows its limitations.
  *