lkml.org 
[lkml]   [2013]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 03/34] 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>
---
include/linux/sched.h | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

Index: linux-2.6/include/linux/sched.h
===================================================================
--- linux-2.6.orig/include/linux/sched.h
+++ linux-2.6/include/linux/sched.h
@@ -2473,7 +2473,7 @@ static inline unsigned long *end_of_stac
#endif

/*
- * Idle thread specific functions to determine the need_resched
+ * Idle thread specific functions for the the need_resched
* polling state. We have two versions, one based on TS_POLLING in
* thread_info.status and one based on TIF_POLLING_NRFLAG in
* thread_info.flags
@@ -2483,13 +2483,34 @@ static inline int tsk_is_polling(struct
{
return task_thread_info(p)->status & TS_POLLING;
}
+static inline void current_set_polling(void)
+{
+ current_thread_info()->status |= TS_POLLING;
+}
+
+static inline void current_clr_polling(void)
+{
+ current_thread_info()->status &= ~TS_POLLING;
+ smp_mb__after_clear_bit();
+}
#elif defined(TIF_POLLING_NRFLAG)
static inline int tsk_is_polling(struct task_struct *p)
{
test_tsk_thread_flag(p, TIF_POLLING_NRFLAG);
}
+static inline void current_set_polling(void)
+{
+ set_thread_flag(TIF_POLLING_NRFLAG);
+}
+
+static inline void current_clr_polling(void)
+{
+ clear_thread_flag(TIF_POLLING_NRFLAG);
+}
#else
static inline int tsk_is_polling(struct task_struct *p) { return 0; }
+static inline void current_set_polling(void) { }
+static inline void current_clr_polling(void) { }
#endif

static inline int object_is_on_stack(void *obj)



\
 
 \ /
  Last update: 2013-03-21 23:21    [W:1.387 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site