Lines Matching refs:tsk
77 /* Used in tsk->state: */
83 /* Used in tsk->exit_state: */
87 /* Used in tsk->state again: */
1059 /* cg_list protected by css_set_lock and tsk->alloc_lock: */
1341 static inline pid_t task_pid_nr(struct task_struct *tsk)
1343 return tsk->pid;
1346 static inline pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1348 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
1351 static inline pid_t task_pid_vnr(struct task_struct *tsk)
1353 return __task_pid_nr_ns(tsk, PIDTYPE_PID, NULL);
1357 static inline pid_t task_tgid_nr(struct task_struct *tsk)
1359 return tsk->tgid;
1377 static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1379 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
1382 static inline pid_t task_pgrp_vnr(struct task_struct *tsk)
1384 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, NULL);
1388 static inline pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1390 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
1393 static inline pid_t task_session_vnr(struct task_struct *tsk)
1395 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL);
1398 static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1400 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, ns);
1403 static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1405 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, NULL);
1408 static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1413 if (pid_alive(tsk))
1414 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1420 static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1422 return task_ppid_nr_ns(tsk, &init_pid_ns);
1426 static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1428 return task_pgrp_nr_ns(tsk, &init_pid_ns);
1434 static inline unsigned int task_state_index(struct task_struct *tsk)
1436 unsigned int tsk_state = READ_ONCE(tsk->state);
1437 unsigned int state = (tsk_state | tsk->exit_state) & TASK_REPORT;
1456 static inline char task_state_to_char(struct task_struct *tsk)
1458 return task_index_to_char(task_state_index(tsk));
1464 * @tsk: Task structure to be checked.
1470 static inline int is_global_init(struct task_struct *tsk)
1472 return task_tgid_nr(tsk) == 1;
1510 * Only the _current_ task can read/write to tsk->flags, but other
1511 * tasks can access tsk->flags in readonly mode for example
1707 extern int wake_up_state(struct task_struct *tsk, unsigned int state);
1708 extern int wake_up_process(struct task_struct *tsk);
1709 extern void wake_up_new_task(struct task_struct *tsk);
1712 extern void kick_process(struct task_struct *tsk);
1714 static inline void kick_process(struct task_struct *tsk) { }
1717 extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
1719 static inline void set_task_comm(struct task_struct *tsk, const char *from)
1721 __set_task_comm(tsk, from, false);
1724 extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
1725 #define get_task_comm(buf, tsk) ({ \
1727 __get_task_comm(buf, sizeof(buf), tsk); \
1745 static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
1747 set_ti_thread_flag(task_thread_info(tsk), flag);
1750 static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1752 clear_ti_thread_flag(task_thread_info(tsk), flag);
1755 static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag,
1758 update_ti_thread_flag(task_thread_info(tsk), flag, value);
1761 static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
1763 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
1766 static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1768 return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
1771 static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
1773 return test_ti_thread_flag(task_thread_info(tsk), flag);
1776 static inline void set_tsk_need_resched(struct task_struct *tsk)
1778 set_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1781 static inline void clear_tsk_need_resched(struct task_struct *tsk)
1783 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1786 static inline int test_tsk_need_resched(struct task_struct *tsk)
1788 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
1891 #define TASK_SIZE_OF(tsk) TASK_SIZE
2002 void __exit_umh(struct task_struct *tsk);
2004 static inline void exit_umh(struct task_struct *tsk)
2006 if (unlikely(tsk->flags & PF_UMH))
2007 __exit_umh(tsk);