aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-25 22:45:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:09 -0400
commit85ba2d862e521375a8ee01526c5c46b1f24bb4af (patch)
treef098555cb580b2864f145aa845b574f07d2cf694 /include/linux
parent1f5a4ad97a0e7b663d527ecc02aabe203d000d91 (diff)
tracehook: wait_task_inactive
This extends wait_task_inactive() with a new argument so it can be used in a "soft" mode where it will check for the task changing state unexpectedly and back off. There is no change to existing callers. This lays the groundwork to allow robust, noninvasive tracing that can try to sample a blocked thread but back off safely if it wakes up. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a95d84d0da95..f59318a0099b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1882,9 +1882,13 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
1882extern char *get_task_comm(char *to, struct task_struct *tsk); 1882extern char *get_task_comm(char *to, struct task_struct *tsk);
1883 1883
1884#ifdef CONFIG_SMP 1884#ifdef CONFIG_SMP
1885extern void wait_task_inactive(struct task_struct * p); 1885extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
1886#else 1886#else
1887#define wait_task_inactive(p) do { } while (0) 1887static inline unsigned long wait_task_inactive(struct task_struct *p,
1888 long match_state)
1889{
1890 return 1;
1891}
1888#endif 1892#endif
1889 1893
1890#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 1894#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)