Lines Matching refs:tsk
247 #define __set_task_state(tsk, state_value) \ argument
249 (tsk)->task_state_change = _THIS_IP_; \
250 (tsk)->state = (state_value); \
252 #define set_task_state(tsk, state_value) \ argument
254 (tsk)->task_state_change = _THIS_IP_; \
255 set_mb((tsk)->state, (state_value)); \
282 #define __set_task_state(tsk, state_value) \ argument
283 do { (tsk)->state = (state_value); } while (0)
284 #define set_task_state(tsk, state_value) \ argument
285 set_mb((tsk)->state, (state_value))
1731 #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) argument
1811 static inline pid_t task_pid_nr(struct task_struct *tsk) in task_pid_nr() argument
1813 return tsk->pid; in task_pid_nr()
1816 static inline pid_t task_pid_nr_ns(struct task_struct *tsk, in task_pid_nr_ns() argument
1819 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns); in task_pid_nr_ns()
1822 static inline pid_t task_pid_vnr(struct task_struct *tsk) in task_pid_vnr() argument
1824 return __task_pid_nr_ns(tsk, PIDTYPE_PID, NULL); in task_pid_vnr()
1828 static inline pid_t task_tgid_nr(struct task_struct *tsk) in task_tgid_nr() argument
1830 return tsk->tgid; in task_tgid_nr()
1833 pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns);
1835 static inline pid_t task_tgid_vnr(struct task_struct *tsk) in task_tgid_vnr() argument
1837 return pid_vnr(task_tgid(tsk)); in task_tgid_vnr()
1842 static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) in task_ppid_nr_ns() argument
1847 if (pid_alive(tsk)) in task_ppid_nr_ns()
1848 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); in task_ppid_nr_ns()
1854 static inline pid_t task_ppid_nr(const struct task_struct *tsk) in task_ppid_nr() argument
1856 return task_ppid_nr_ns(tsk, &init_pid_ns); in task_ppid_nr()
1859 static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, in task_pgrp_nr_ns() argument
1862 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns); in task_pgrp_nr_ns()
1865 static inline pid_t task_pgrp_vnr(struct task_struct *tsk) in task_pgrp_vnr() argument
1867 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, NULL); in task_pgrp_vnr()
1871 static inline pid_t task_session_nr_ns(struct task_struct *tsk, in task_session_nr_ns() argument
1874 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns); in task_session_nr_ns()
1877 static inline pid_t task_session_vnr(struct task_struct *tsk) in task_session_vnr() argument
1879 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); in task_session_vnr()
1883 static inline pid_t task_pgrp_nr(struct task_struct *tsk) in task_pgrp_nr() argument
1885 return task_pgrp_nr_ns(tsk, &init_pid_ns); in task_pgrp_nr()
1911 static inline int is_global_init(struct task_struct *tsk) in is_global_init() argument
1913 return tsk->pid == 1; in is_global_init()
1918 extern void free_task(struct task_struct *tsk);
1919 #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) argument
2356 extern int wake_up_state(struct task_struct *tsk, unsigned int state);
2357 extern int wake_up_process(struct task_struct *tsk);
2358 extern void wake_up_new_task(struct task_struct *tsk);
2360 extern void kick_process(struct task_struct *tsk);
2362 static inline void kick_process(struct task_struct *tsk) { } in kick_process() argument
2372 extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info);
2374 static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) in dequeue_signal_lock() argument
2379 spin_lock_irqsave(&tsk->sighand->siglock, flags); in dequeue_signal_lock()
2380 ret = dequeue_signal(tsk, mask, info); in dequeue_signal_lock()
2381 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); in dequeue_signal_lock()
2517 extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
2518 static inline void set_task_comm(struct task_struct *tsk, const char *from) in set_task_comm() argument
2520 __set_task_comm(tsk, from, false); in set_task_comm()
2522 extern char *get_task_comm(char *to, struct task_struct *tsk);
2564 static inline int get_nr_threads(struct task_struct *tsk) in get_nr_threads() argument
2566 return tsk->signal->nr_threads; in get_nr_threads()
2625 extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
2628 static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk, in lock_task_sighand() argument
2633 ret = __lock_task_sighand(tsk, flags); in lock_task_sighand()
2634 (void)__cond_lock(&tsk->sighand->siglock, ret); in lock_task_sighand()
2638 static inline void unlock_task_sighand(struct task_struct *tsk, in unlock_task_sighand() argument
2641 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); in unlock_task_sighand()
2645 static inline void threadgroup_change_begin(struct task_struct *tsk) in threadgroup_change_begin() argument
2647 down_read(&tsk->signal->group_rwsem); in threadgroup_change_begin()
2649 static inline void threadgroup_change_end(struct task_struct *tsk) in threadgroup_change_end() argument
2651 up_read(&tsk->signal->group_rwsem); in threadgroup_change_end()
2670 static inline void threadgroup_lock(struct task_struct *tsk) in threadgroup_lock() argument
2672 down_write(&tsk->signal->group_rwsem); in threadgroup_lock()
2681 static inline void threadgroup_unlock(struct task_struct *tsk) in threadgroup_unlock() argument
2683 up_write(&tsk->signal->group_rwsem); in threadgroup_unlock()
2686 static inline void threadgroup_change_begin(struct task_struct *tsk) {} in threadgroup_change_begin() argument
2687 static inline void threadgroup_change_end(struct task_struct *tsk) {} in threadgroup_change_end() argument
2688 static inline void threadgroup_lock(struct task_struct *tsk) {} in threadgroup_lock() argument
2689 static inline void threadgroup_unlock(struct task_struct *tsk) {} in threadgroup_unlock() argument
2746 extern void set_task_stack_end_magic(struct task_struct *tsk);
2751 static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) in set_tsk_thread_flag() argument
2753 set_ti_thread_flag(task_thread_info(tsk), flag); in set_tsk_thread_flag()
2756 static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) in clear_tsk_thread_flag() argument
2758 clear_ti_thread_flag(task_thread_info(tsk), flag); in clear_tsk_thread_flag()
2761 static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) in test_and_set_tsk_thread_flag() argument
2763 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); in test_and_set_tsk_thread_flag()
2766 static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) in test_and_clear_tsk_thread_flag() argument
2768 return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); in test_and_clear_tsk_thread_flag()
2771 static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) in test_tsk_thread_flag() argument
2773 return test_ti_thread_flag(task_thread_info(tsk), flag); in test_tsk_thread_flag()
2776 static inline void set_tsk_need_resched(struct task_struct *tsk) in set_tsk_need_resched() argument
2778 set_tsk_thread_flag(tsk,TIF_NEED_RESCHED); in set_tsk_need_resched()
2781 static inline void clear_tsk_need_resched(struct task_struct *tsk) in clear_tsk_need_resched() argument
2783 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); in clear_tsk_need_resched()
2786 static inline int test_tsk_need_resched(struct task_struct *tsk) in test_tsk_need_resched() argument
2788 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); in test_tsk_need_resched()
2957 void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
2958 void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
3023 struct task_struct *tsk);
3026 static inline void add_rchar(struct task_struct *tsk, ssize_t amt) in add_rchar() argument
3028 tsk->ioac.rchar += amt; in add_rchar()
3031 static inline void add_wchar(struct task_struct *tsk, ssize_t amt) in add_wchar() argument
3033 tsk->ioac.wchar += amt; in add_wchar()
3036 static inline void inc_syscr(struct task_struct *tsk) in inc_syscr() argument
3038 tsk->ioac.syscr++; in inc_syscr()
3041 static inline void inc_syscw(struct task_struct *tsk) in inc_syscw() argument
3043 tsk->ioac.syscw++; in inc_syscw()
3046 static inline void add_rchar(struct task_struct *tsk, ssize_t amt) in add_rchar() argument
3050 static inline void add_wchar(struct task_struct *tsk, ssize_t amt) in add_wchar() argument
3054 static inline void inc_syscr(struct task_struct *tsk) in inc_syscr() argument
3058 static inline void inc_syscw(struct task_struct *tsk) in inc_syscw() argument
3064 #define TASK_SIZE_OF(tsk) TASK_SIZE argument
3075 static inline unsigned long task_rlimit(const struct task_struct *tsk, in task_rlimit() argument
3078 return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); in task_rlimit()
3081 static inline unsigned long task_rlimit_max(const struct task_struct *tsk, in task_rlimit_max() argument
3084 return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); in task_rlimit_max()