diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-02-06 04:57:33 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-03-02 19:45:22 -0500 |
commit | 56cd697366b6d6f67acb6c58ac7f3b185d11ef07 (patch) | |
tree | c0866c89f50b5c511d88ab356845b4eb534cda87 /include/linux/sched/task.h | |
parent | cdc75e9f7b14f29efcf4b162a3c673733e96db79 (diff) |
sched/headers: Move the task_lock()/unlock() APIs to <linux/sched/task.h>
The task_lock()/task_unlock() APIs are not realated to core scheduling,
they are task lifetime APIs, i.e. they belong into <linux/sched/task.h>.
Move them.
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched/task.h')
-rw-r--r-- | include/linux/sched/task.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 1be049a18d1b..2be9fde588a7 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h | |||
@@ -91,4 +91,24 @@ static inline struct vm_struct *task_stack_vm_area(const struct task_struct *t) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | /* | ||
95 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring | ||
96 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | ||
97 | * pins the final release of task.io_context. Also protects ->cpuset and | ||
98 | * ->cgroup.subsys[]. And ->vfork_done. | ||
99 | * | ||
100 | * Nests both inside and outside of read_lock(&tasklist_lock). | ||
101 | * It must not be nested with write_lock_irq(&tasklist_lock), | ||
102 | * neither inside nor outside. | ||
103 | */ | ||
104 | static inline void task_lock(struct task_struct *p) | ||
105 | { | ||
106 | spin_lock(&p->alloc_lock); | ||
107 | } | ||
108 | |||
109 | static inline void task_unlock(struct task_struct *p) | ||
110 | { | ||
111 | spin_unlock(&p->alloc_lock); | ||
112 | } | ||
113 | |||
94 | #endif /* _LINUX_SCHED_TASK_H */ | 114 | #endif /* _LINUX_SCHED_TASK_H */ |