aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-03-21 17:49:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-04-08 11:39:22 -0400
commit3a98f871ecaf44806e188184332c3fec27c8f08c (patch)
treeeaa95ad4a4762719a2c5b255e9e5444fae23943c /include/linux/sched.h
parentee761f629d598579594d7e1eb8c552f3c5f71e4d (diff)
idle: Implement set/clr functions for need_resched poll
Implement set/clear functions for the idle need_resched poll implementation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Cc: Magnus Damm <magnus.damm@gmail.com> Link: http://lkml.kernel.org/r/20130321215233.518839807@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6709a5813f27..21fe9a142e51 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2632,13 +2632,34 @@ static inline int tsk_is_polling(struct task_struct *p)
2632{ 2632{
2633 return task_thread_info(p)->status & TS_POLLING; 2633 return task_thread_info(p)->status & TS_POLLING;
2634} 2634}
2635static inline void current_set_polling(void)
2636{
2637 current_thread_info()->status |= TS_POLLING;
2638}
2639
2640static inline void current_clr_polling(void)
2641{
2642 current_thread_info()->status &= ~TS_POLLING;
2643 smp_mb__after_clear_bit();
2644}
2635#elif defined(TIF_POLLING_NRFLAG) 2645#elif defined(TIF_POLLING_NRFLAG)
2636static inline int tsk_is_polling(struct task_struct *p) 2646static inline int tsk_is_polling(struct task_struct *p)
2637{ 2647{
2638 return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); 2648 return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
2639} 2649}
2650static inline void current_set_polling(void)
2651{
2652 set_thread_flag(TIF_POLLING_NRFLAG);
2653}
2654
2655static inline void current_clr_polling(void)
2656{
2657 clear_thread_flag(TIF_POLLING_NRFLAG);
2658}
2640#else 2659#else
2641static inline int tsk_is_polling(struct task_struct *p) { return 0; } 2660static inline int tsk_is_polling(struct task_struct *p) { return 0; }
2661static inline void current_set_polling(void) { }
2662static inline void current_clr_polling(void) { }
2642#endif 2663#endif
2643 2664
2644/* 2665/*