diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-31 14:59:16 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:38:11 (GMT) |
commit | df2a11dd4e83ec518bff448eb2645931192e0d27 (patch) | |
tree | 06545b1071f5b508fb31d57d651496396bef5374 /include/linux | |
parent | 62630bcefd277c0647f4b47bac54e0c0ef077c93 (diff) | |
download | linux-fsl-qoriq-df2a11dd4e83ec518bff448eb2645931192e0d27.tar.xz |
sched-delay-put-task.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index a6dc6b6..cf866a5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1430,6 +1430,9 @@ struct task_struct { unsigned int sequential_io; unsigned int sequential_io_avg; #endif +#ifdef CONFIG_PREEMPT_RT_BASE + struct rcu_head put_rcu; +#endif }; /* Future-safe accessor for struct task_struct's cpus_allowed. */ @@ -1593,6 +1596,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) @@ -1600,6 +1612,7 @@ static inline void put_task_struct(struct task_struct *t) if (atomic_dec_and_test(&t->usage)) __put_task_struct(t); } +#endif #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN extern void task_cputime(struct task_struct *t, |