Lines Matching defs:tsk

81 /* Used in tsk->state: */
87 /* Used in tsk->exit_state: */
91 /* Used in tsk->state again: */
1116 /* cg_list protected by css_set_lock and tsk->alloc_lock: */
1425 static inline pid_t task_pid_nr(struct task_struct *tsk)
1427 return tsk->pid;
1430 static inline pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1432 return __task_pid_nr_ns(tsk, PIDTYPE_PID, ns);
1435 static inline pid_t task_pid_vnr(struct task_struct *tsk)
1437 return __task_pid_nr_ns(tsk, PIDTYPE_PID, NULL);
1441 static inline pid_t task_tgid_nr(struct task_struct *tsk)
1443 return tsk->tgid;
1461 static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1463 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, ns);
1466 static inline pid_t task_pgrp_vnr(struct task_struct *tsk)
1468 return __task_pid_nr_ns(tsk, PIDTYPE_PGID, NULL);
1472 static inline pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1474 return __task_pid_nr_ns(tsk, PIDTYPE_SID, ns);
1477 static inline pid_t task_session_vnr(struct task_struct *tsk)
1479 return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL);
1482 static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns)
1484 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, ns);
1487 static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1489 return __task_pid_nr_ns(tsk, PIDTYPE_TGID, NULL);
1492 static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1497 if (pid_alive(tsk))
1498 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1504 static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1506 return task_ppid_nr_ns(tsk, &init_pid_ns);
1510 static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1512 return task_pgrp_nr_ns(tsk, &init_pid_ns);
1518 static inline unsigned int task_state_index(struct task_struct *tsk)
1520 unsigned int tsk_state = READ_ONCE(tsk->state);
1521 unsigned int state = (tsk_state | tsk->exit_state) & TASK_REPORT;
1540 static inline char task_state_to_char(struct task_struct *tsk)
1542 return task_index_to_char(task_state_index(tsk));
1548 * @tsk: Task structure to be checked.
1554 static inline int is_global_init(struct task_struct *tsk)
1556 return task_tgid_nr(tsk) == 1;
1594 * Only the _current_ task can read/write to tsk->flags, but other
1595 * tasks can access tsk->flags in readonly mode for example
1805 extern int wake_up_state(struct task_struct *tsk, unsigned int state);
1806 extern int wake_up_process(struct task_struct *tsk);
1807 extern void wake_up_new_task(struct task_struct *tsk);
1810 extern void kick_process(struct task_struct *tsk);
1812 static inline void kick_process(struct task_struct *tsk) { }
1815 extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
1817 static inline void set_task_comm(struct task_struct *tsk, const char *from)
1819 __set_task_comm(tsk, from, false);
1822 extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
1823 #define get_task_comm(buf, tsk) ({ \
1825 __get_task_comm(buf, sizeof(buf), tsk); \
1851 static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
1853 set_ti_thread_flag(task_thread_info(tsk), flag);
1856 static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1858 clear_ti_thread_flag(task_thread_info(tsk), flag);
1861 static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag,
1864 update_ti_thread_flag(task_thread_info(tsk), flag, value);
1867 static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
1869 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
1872 static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1874 return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
1877 static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
1879 return test_ti_thread_flag(task_thread_info(tsk), flag);
1882 static inline void set_tsk_need_resched(struct task_struct *tsk)
1884 set_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1887 static inline void clear_tsk_need_resched(struct task_struct *tsk)
1889 clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED);
1892 static inline int test_tsk_need_resched(struct task_struct *tsk)
1894 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
1997 #define TASK_SIZE_OF(tsk) TASK_SIZE