diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 3 | ||||
| -rw-r--r-- | include/linux/sched/task.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index e2bba022827d..9d14d6864ca6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/seccomp.h> | 21 | #include <linux/seccomp.h> |
| 22 | #include <linux/nodemask.h> | 22 | #include <linux/nodemask.h> |
| 23 | #include <linux/rcupdate.h> | 23 | #include <linux/rcupdate.h> |
| 24 | #include <linux/refcount.h> | ||
| 24 | #include <linux/resource.h> | 25 | #include <linux/resource.h> |
| 25 | #include <linux/latencytop.h> | 26 | #include <linux/latencytop.h> |
| 26 | #include <linux/sched/prio.h> | 27 | #include <linux/sched/prio.h> |
| @@ -607,7 +608,7 @@ struct task_struct { | |||
| 607 | randomized_struct_fields_start | 608 | randomized_struct_fields_start |
| 608 | 609 | ||
| 609 | void *stack; | 610 | void *stack; |
| 610 | atomic_t usage; | 611 | refcount_t usage; |
| 611 | /* Per task flags (PF_*), defined further below: */ | 612 | /* Per task flags (PF_*), defined further below: */ |
| 612 | unsigned int flags; | 613 | unsigned int flags; |
| 613 | unsigned int ptrace; | 614 | unsigned int ptrace; |
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 44c6f15800ff..2e97a2227045 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h | |||
| @@ -88,13 +88,13 @@ extern void sched_exec(void); | |||
| 88 | #define sched_exec() {} | 88 | #define sched_exec() {} |
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 91 | #define get_task_struct(tsk) do { refcount_inc(&(tsk)->usage); } while(0) |
| 92 | 92 | ||
| 93 | extern void __put_task_struct(struct task_struct *t); | 93 | extern void __put_task_struct(struct task_struct *t); |
| 94 | 94 | ||
| 95 | static inline void put_task_struct(struct task_struct *t) | 95 | static inline void put_task_struct(struct task_struct *t) |
| 96 | { | 96 | { |
| 97 | if (atomic_dec_and_test(&t->usage)) | 97 | if (refcount_dec_and_test(&t->usage)) |
| 98 | __put_task_struct(t); | 98 | __put_task_struct(t); |
| 99 | } | 99 | } |
| 100 | 100 | ||
