summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-05-31 16:59:16 +0200
committerSteven Rostedt <rostedt@rostedt.homelinux.com>2013-12-06 20:55:10 -0500
commita586b8f66e2264b1473ef99ee1b74318389f1a61 (patch)
tree3bcb5e287145ae60bf457608f14b1095b7e6e313 /include
parent7ae81fae08e8a3a921cb040a00231e36b849e3d1 (diff)
downloadlinux-rt-a586b8f66e2264b1473ef99ee1b74318389f1a61.tar.gz
sched-delay-put-task.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d99276a2c105..0a87d51d6624 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1642,6 +1642,9 @@ struct task_struct {
#ifdef CONFIG_HAVE_HW_BREAKPOINT
atomic_t ptrace_bp_refcnt;
#endif
+#ifdef CONFIG_PREEMPT_RT_BASE
+ struct rcu_head put_rcu;
+#endif
};
/* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -1826,6 +1829,15 @@ extern struct pid *cad_pid;
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
+#ifdef CONFIG_PREEMPT_RT_BASE
+extern void __put_task_struct_cb(struct rcu_head *rhp);
+
+static inline void put_task_struct(struct task_struct *t)
+{
+ if (atomic_dec_and_test(&t->usage))
+ call_rcu(&t->put_rcu, __put_task_struct_cb);
+}
+#else
extern void __put_task_struct(struct task_struct *t);
static inline void put_task_struct(struct task_struct *t)
@@ -1833,6 +1845,7 @@ static inline void put_task_struct(struct task_struct *t)
if (atomic_dec_and_test(&t->usage))
__put_task_struct(t);
}
+#endif
extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st);