aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 10:50:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 10:50:17 -0400
commit8700c95adb033843fc163d112b9d21d4fda78018 (patch)
tree7bb9a37b8fe6328f63a61d88063c556346001098 /include
parent16fa94b532b1958f508e07eca1a9256351241fbc (diff)
parentd190e8195b90bc1e65c494fe08e54e9e581bfd16 (diff)
Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull SMP/hotplug changes from Ingo Molnar: "This is a pretty large, multi-arch series unifying and generalizing the various disjunct pieces of idle routines that architectures have historically copied from each other and have grown in random, wildly inconsistent and sometimes buggy directions: 101 files changed, 455 insertions(+), 1328 deletions(-) this went through a number of review and test iterations before it was committed, it was tested on various architectures, was exposed to linux-next for quite some time - nevertheless it might cause problems on architectures that don't read the mailing lists and don't regularly test linux-next. This cat herding excercise was motivated by the -rt kernel, and was brought to you by Thomas "the Whip" Gleixner." * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits) idle: Remove GENERIC_IDLE_LOOP config switch um: Use generic idle loop ia64: Make sure interrupts enabled when we "safe_halt()" sparc: Use generic idle loop idle: Remove unused ARCH_HAS_DEFAULT_IDLE bfin: Fix typo in arch_cpu_idle() xtensa: Use generic idle loop x86: Use generic idle loop unicore: Use generic idle loop tile: Use generic idle loop tile: Enter idle with preemption disabled sh: Use generic idle loop score: Use generic idle loop s390: Use generic idle loop powerpc: Use generic idle loop parisc: Use generic idle loop openrisc: Use generic idle loop mn10300: Use generic idle loop mips: Use generic idle loop microblaze: Use generic idle loop ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/cpu.h16
-rw-r--r--include/linux/sched.h41
2 files changed, 57 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index ce7a074f2519..c6f6e0839b61 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -212,4 +212,20 @@ static inline int disable_nonboot_cpus(void) { return 0; }
212static inline void enable_nonboot_cpus(void) {} 212static inline void enable_nonboot_cpus(void) {}
213#endif /* !CONFIG_PM_SLEEP_SMP */ 213#endif /* !CONFIG_PM_SLEEP_SMP */
214 214
215enum cpuhp_state {
216 CPUHP_OFFLINE,
217 CPUHP_ONLINE,
218};
219
220void cpu_startup_entry(enum cpuhp_state state);
221void cpu_idle(void);
222
223void cpu_idle_poll_ctrl(bool enable);
224
225void arch_cpu_idle(void);
226void arch_cpu_idle_prepare(void);
227void arch_cpu_idle_enter(void);
228void arch_cpu_idle_exit(void);
229void arch_cpu_idle_dead(void);
230
215#endif /* _LINUX_CPU_H_ */ 231#endif /* _LINUX_CPU_H_ */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 01c7d85bcaa7..981ab6887259 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2457,6 +2457,47 @@ static inline int spin_needbreak(spinlock_t *lock)
2457} 2457}
2458 2458
2459/* 2459/*
2460 * Idle thread specific functions to determine the need_resched
2461 * polling state. We have two versions, one based on TS_POLLING in
2462 * thread_info.status and one based on TIF_POLLING_NRFLAG in
2463 * thread_info.flags
2464 */
2465#ifdef TS_POLLING
2466static inline int tsk_is_polling(struct task_struct *p)
2467{
2468 return task_thread_info(p)->status & TS_POLLING;
2469}
2470static inline void current_set_polling(void)
2471{
2472 current_thread_info()->status |= TS_POLLING;
2473}
2474
2475static inline void current_clr_polling(void)
2476{
2477 current_thread_info()->status &= ~TS_POLLING;
2478 smp_mb__after_clear_bit();
2479}
2480#elif defined(TIF_POLLING_NRFLAG)
2481static inline int tsk_is_polling(struct task_struct *p)
2482{
2483 return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
2484}
2485static inline void current_set_polling(void)
2486{
2487 set_thread_flag(TIF_POLLING_NRFLAG);
2488}
2489
2490static inline void current_clr_polling(void)
2491{
2492 clear_thread_flag(TIF_POLLING_NRFLAG);
2493}
2494#else
2495static inline int tsk_is_polling(struct task_struct *p) { return 0; }
2496static inline void current_set_polling(void) { }
2497static inline void current_clr_polling(void) { }
2498#endif
2499
2500/*
2460 * Thread group CPU time accounting. 2501 * Thread group CPU time accounting.
2461 */ 2502 */
2462void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); 2503void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);