Lines Matching refs:tsk

84 /* Used in tsk->state: */

90 /* Used in tsk->exit_state: */
94 /* Used in tsk->state again: */
1222 /* cg_list protected by css_set_lock and tsk->alloc_lock: */
1529 static inline pid_t task_pid_nr(struct task_struct *tsk)
1531 return tsk->pid;
1534 static inline pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1536 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
1539 static inline pid_t task_pid_vnr(struct task_struct *tsk)
1541 return __task_pid_nr_ns(tsk, PIDTYPE_PID, NULL);
1544 static inline pid_t task_tgid_nr(struct task_struct *tsk)
1546 return tsk->tgid;
1564 static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1566 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
1569 static inline pid_t task_pgrp_vnr(struct task_struct *tsk)
1571 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, NULL);
1574 static inline pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1576 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
1579 static inline pid_t task_session_vnr(struct task_struct *tsk)
1581 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL);
1584 static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1586 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, ns);
1589 static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1591 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, NULL);
1594 static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1599 if (pid_alive(tsk)) {
1600 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1607 static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1609 return task_ppid_nr_ns(tsk, &init_pid_ns);
1613 static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1615 return task_pgrp_nr_ns(tsk, &init_pid_ns);
1621 static inline unsigned int task_state_index(struct task_struct *tsk)
1623 unsigned int tsk_state = READ_ONCE(tsk->state);
1624 unsigned int state = (tsk_state | tsk->exit_state) & TASK_REPORT;
1644 static inline char task_state_to_char(struct task_struct *tsk)
1646 return task_index_to_char(task_state_index(tsk));
1652 * @tsk: Task structure to be checked.
1658 static inline int is_global_init(struct task_struct *tsk)
1660 return task_tgid_nr(tsk) == 1;
1699 * Only the _current_ task can read/write to tsk->flags, but other
1700 * tasks can access tsk->flags in readonly mode for example
1914 extern int wake_up_state(struct task_struct *tsk, unsigned int state);
1915 extern int wake_up_process(struct task_struct *tsk);
1916 extern void wake_up_new_task(struct task_struct *tsk);
1919 extern void kick_process(struct task_struct *tsk);
1921 static inline void kick_process(struct task_struct *tsk)
1926 extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
1928 static inline void set_task_comm(struct task_struct *tsk, const char *from)
1930 __set_task_comm(tsk, from, false);
1933 extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
1934 #define get_task_comm(buf, tsk) \
1937 __get_task_comm(buf, sizeof(buf), tsk); \
1965 static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
1967 set_ti_thread_flag(task_thread_info(tsk), flag);
1970 static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1972 clear_ti_thread_flag(task_thread_info(tsk), flag);
1975 static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, bool value)
1977 update_ti_thread_flag(task_thread_info(tsk), flag, value);
1980 static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
1982 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
1985 static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1987 return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
1990 static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
1992 return test_ti_thread_flag(task_thread_info(tsk), flag);
1995 static inline void set_tsk_need_resched(struct task_struct *tsk)
1997 set_tsk_thread_flag(tsk, TIF_NEED_RESCHED);
2000 static inline void clear_tsk_need_resched(struct task_struct *tsk)
2002 clear_tsk_thread_flag(tsk, TIF_NEED_RESCHED);
2005 static inline int test_tsk_need_resched(struct task_struct *tsk)
2007 return unlikely(test_tsk_thread_flag(tsk, TIF_NEED_RESCHED));
2115 #define TASK_SIZE_OF(tsk) TASK_SIZE