diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 96 |
1 files changed, 41 insertions, 55 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 2d1e840ddd35..8395e715809d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -96,6 +96,7 @@ struct exec_domain; | |||
96 | struct futex_pi_state; | 96 | struct futex_pi_state; |
97 | struct robust_list_head; | 97 | struct robust_list_head; |
98 | struct bio; | 98 | struct bio; |
99 | struct bts_tracer; | ||
99 | 100 | ||
100 | /* | 101 | /* |
101 | * List of flags we want to share for kernel threads, | 102 | * List of flags we want to share for kernel threads, |
@@ -570,12 +571,6 @@ struct signal_struct { | |||
570 | */ | 571 | */ |
571 | struct rlimit rlim[RLIM_NLIMITS]; | 572 | struct rlimit rlim[RLIM_NLIMITS]; |
572 | 573 | ||
573 | /* keep the process-shared keyrings here so that they do the right | ||
574 | * thing in threads created with CLONE_THREAD */ | ||
575 | #ifdef CONFIG_KEYS | ||
576 | struct key *session_keyring; /* keyring inherited over fork */ | ||
577 | struct key *process_keyring; /* keyring private to this process */ | ||
578 | #endif | ||
579 | #ifdef CONFIG_BSD_PROCESS_ACCT | 574 | #ifdef CONFIG_BSD_PROCESS_ACCT |
580 | struct pacct_struct pacct; /* per-process accounting information */ | 575 | struct pacct_struct pacct; /* per-process accounting information */ |
581 | #endif | 576 | #endif |
@@ -646,6 +641,7 @@ struct user_struct { | |||
646 | /* Hash table maintenance information */ | 641 | /* Hash table maintenance information */ |
647 | struct hlist_node uidhash_node; | 642 | struct hlist_node uidhash_node; |
648 | uid_t uid; | 643 | uid_t uid; |
644 | struct user_namespace *user_ns; | ||
649 | 645 | ||
650 | #ifdef CONFIG_USER_SCHED | 646 | #ifdef CONFIG_USER_SCHED |
651 | struct task_group *tg; | 647 | struct task_group *tg; |
@@ -663,6 +659,7 @@ extern struct user_struct *find_user(uid_t); | |||
663 | extern struct user_struct root_user; | 659 | extern struct user_struct root_user; |
664 | #define INIT_USER (&root_user) | 660 | #define INIT_USER (&root_user) |
665 | 661 | ||
662 | |||
666 | struct backing_dev_info; | 663 | struct backing_dev_info; |
667 | struct reclaim_state; | 664 | struct reclaim_state; |
668 | 665 | ||
@@ -885,38 +882,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
885 | #endif /* !CONFIG_SMP */ | 882 | #endif /* !CONFIG_SMP */ |
886 | 883 | ||
887 | struct io_context; /* See blkdev.h */ | 884 | struct io_context; /* See blkdev.h */ |
888 | #define NGROUPS_SMALL 32 | ||
889 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) | ||
890 | struct group_info { | ||
891 | int ngroups; | ||
892 | atomic_t usage; | ||
893 | gid_t small_block[NGROUPS_SMALL]; | ||
894 | int nblocks; | ||
895 | gid_t *blocks[0]; | ||
896 | }; | ||
897 | |||
898 | /* | ||
899 | * get_group_info() must be called with the owning task locked (via task_lock()) | ||
900 | * when task != current. The reason being that the vast majority of callers are | ||
901 | * looking at current->group_info, which can not be changed except by the | ||
902 | * current task. Changing current->group_info requires the task lock, too. | ||
903 | */ | ||
904 | #define get_group_info(group_info) do { \ | ||
905 | atomic_inc(&(group_info)->usage); \ | ||
906 | } while (0) | ||
907 | |||
908 | #define put_group_info(group_info) do { \ | ||
909 | if (atomic_dec_and_test(&(group_info)->usage)) \ | ||
910 | groups_free(group_info); \ | ||
911 | } while (0) | ||
912 | 885 | ||
913 | extern struct group_info *groups_alloc(int gidsetsize); | ||
914 | extern void groups_free(struct group_info *group_info); | ||
915 | extern int set_current_groups(struct group_info *group_info); | ||
916 | extern int groups_search(struct group_info *group_info, gid_t grp); | ||
917 | /* access the groups "array" with this macro */ | ||
918 | #define GROUP_AT(gi, i) \ | ||
919 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) | ||
920 | 886 | ||
921 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK | 887 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK |
922 | extern void prefetch_stack(struct task_struct *t); | 888 | extern void prefetch_stack(struct task_struct *t); |
@@ -1162,6 +1128,19 @@ struct task_struct { | |||
1162 | struct list_head ptraced; | 1128 | struct list_head ptraced; |
1163 | struct list_head ptrace_entry; | 1129 | struct list_head ptrace_entry; |
1164 | 1130 | ||
1131 | #ifdef CONFIG_X86_PTRACE_BTS | ||
1132 | /* | ||
1133 | * This is the tracer handle for the ptrace BTS extension. | ||
1134 | * This field actually belongs to the ptracer task. | ||
1135 | */ | ||
1136 | struct bts_tracer *bts; | ||
1137 | /* | ||
1138 | * The buffer to hold the BTS data. | ||
1139 | */ | ||
1140 | void *bts_buffer; | ||
1141 | size_t bts_size; | ||
1142 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
1143 | |||
1165 | /* PID/PID hash table linkage. */ | 1144 | /* PID/PID hash table linkage. */ |
1166 | struct pid_link pids[PIDTYPE_MAX]; | 1145 | struct pid_link pids[PIDTYPE_MAX]; |
1167 | struct list_head thread_group; | 1146 | struct list_head thread_group; |
@@ -1183,17 +1162,12 @@ struct task_struct { | |||
1183 | struct list_head cpu_timers[3]; | 1162 | struct list_head cpu_timers[3]; |
1184 | 1163 | ||
1185 | /* process credentials */ | 1164 | /* process credentials */ |
1186 | uid_t uid,euid,suid,fsuid; | 1165 | const struct cred *real_cred; /* objective and real subjective task |
1187 | gid_t gid,egid,sgid,fsgid; | 1166 | * credentials (COW) */ |
1188 | struct group_info *group_info; | 1167 | const struct cred *cred; /* effective (overridable) subjective task |
1189 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; | 1168 | * credentials (COW) */ |
1190 | struct user_struct *user; | 1169 | struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */ |
1191 | unsigned securebits; | 1170 | |
1192 | #ifdef CONFIG_KEYS | ||
1193 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | ||
1194 | struct key *request_key_auth; /* assumed request_key authority */ | ||
1195 | struct key *thread_keyring; /* keyring private to this thread */ | ||
1196 | #endif | ||
1197 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1171 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1198 | - access with [gs]et_task_comm (which lock | 1172 | - access with [gs]et_task_comm (which lock |
1199 | it with task_lock()) | 1173 | it with task_lock()) |
@@ -1230,9 +1204,6 @@ struct task_struct { | |||
1230 | int (*notifier)(void *priv); | 1204 | int (*notifier)(void *priv); |
1231 | void *notifier_data; | 1205 | void *notifier_data; |
1232 | sigset_t *notifier_mask; | 1206 | sigset_t *notifier_mask; |
1233 | #ifdef CONFIG_SECURITY | ||
1234 | void *security; | ||
1235 | #endif | ||
1236 | struct audit_context *audit_context; | 1207 | struct audit_context *audit_context; |
1237 | #ifdef CONFIG_AUDITSYSCALL | 1208 | #ifdef CONFIG_AUDITSYSCALL |
1238 | uid_t loginuid; | 1209 | uid_t loginuid; |
@@ -1353,6 +1324,23 @@ struct task_struct { | |||
1353 | unsigned long default_timer_slack_ns; | 1324 | unsigned long default_timer_slack_ns; |
1354 | 1325 | ||
1355 | struct list_head *scm_work_list; | 1326 | struct list_head *scm_work_list; |
1327 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1328 | /* Index of current stored adress in ret_stack */ | ||
1329 | int curr_ret_stack; | ||
1330 | /* Stack of return addresses for return function tracing */ | ||
1331 | struct ftrace_ret_stack *ret_stack; | ||
1332 | /* | ||
1333 | * Number of functions that haven't been traced | ||
1334 | * because of depth overrun. | ||
1335 | */ | ||
1336 | atomic_t trace_overrun; | ||
1337 | /* Pause for the tracing */ | ||
1338 | atomic_t tracing_graph_pause; | ||
1339 | #endif | ||
1340 | #ifdef CONFIG_TRACING | ||
1341 | /* state flags for use by tracers */ | ||
1342 | unsigned long trace; | ||
1343 | #endif | ||
1356 | }; | 1344 | }; |
1357 | 1345 | ||
1358 | /* | 1346 | /* |
@@ -1772,7 +1760,6 @@ static inline struct user_struct *get_uid(struct user_struct *u) | |||
1772 | return u; | 1760 | return u; |
1773 | } | 1761 | } |
1774 | extern void free_uid(struct user_struct *); | 1762 | extern void free_uid(struct user_struct *); |
1775 | extern void switch_uid(struct user_struct *); | ||
1776 | extern void release_uids(struct user_namespace *ns); | 1763 | extern void release_uids(struct user_namespace *ns); |
1777 | 1764 | ||
1778 | #include <asm/current.h> | 1765 | #include <asm/current.h> |
@@ -1791,9 +1778,6 @@ extern void wake_up_new_task(struct task_struct *tsk, | |||
1791 | extern void sched_fork(struct task_struct *p, int clone_flags); | 1778 | extern void sched_fork(struct task_struct *p, int clone_flags); |
1792 | extern void sched_dead(struct task_struct *p); | 1779 | extern void sched_dead(struct task_struct *p); |
1793 | 1780 | ||
1794 | extern int in_group_p(gid_t); | ||
1795 | extern int in_egroup_p(gid_t); | ||
1796 | |||
1797 | extern void proc_caches_init(void); | 1781 | extern void proc_caches_init(void); |
1798 | extern void flush_signals(struct task_struct *); | 1782 | extern void flush_signals(struct task_struct *); |
1799 | extern void ignore_signals(struct task_struct *); | 1783 | extern void ignore_signals(struct task_struct *); |
@@ -1925,6 +1909,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
1925 | #define for_each_process(p) \ | 1909 | #define for_each_process(p) \ |
1926 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1910 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
1927 | 1911 | ||
1912 | extern bool is_single_threaded(struct task_struct *); | ||
1913 | |||
1928 | /* | 1914 | /* |
1929 | * Careful: do_each_thread/while_each_thread is a double loop so | 1915 | * Careful: do_each_thread/while_each_thread is a double loop so |
1930 | * 'break' will not work as expected - use goto instead. | 1916 | * 'break' will not work as expected - use goto instead. |