aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-29 03:45:15 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-29 03:45:15 -0500
commite1df957670aef74ffd9a4ad93e6d2c90bf6b4845 (patch)
treebca1fcfef55b3e3e82c9a822b4ac6428fce2b419 /include/linux/sched.h
parent2b583d8bc8d7105b58d7481a4a0ceb718dac49c6 (diff)
parent3c92ec8ae91ecf59d88c798301833d7cf83f2179 (diff)
Merge branch 'linus' into perfcounters/core
Conflicts: fs/exec.c include/linux/init_task.h Simple context conflicts.
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h102
1 files changed, 43 insertions, 59 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2e15be8fc792..fc2c6f3477e7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -97,6 +97,7 @@ struct exec_domain;
97struct futex_pi_state; 97struct futex_pi_state;
98struct robust_list_head; 98struct robust_list_head;
99struct bio; 99struct bio;
100struct bts_tracer;
100 101
101/* 102/*
102 * List of flags we want to share for kernel threads, 103 * List of flags we want to share for kernel threads,
@@ -260,8 +261,6 @@ static inline int select_nohz_load_balancer(int cpu)
260} 261}
261#endif 262#endif
262 263
263extern unsigned long rt_needs_cpu(int cpu);
264
265/* 264/*
266 * Only dump TASK_* tasks. (0 for all tasks) 265 * Only dump TASK_* tasks. (0 for all tasks)
267 */ 266 */
@@ -573,12 +572,6 @@ struct signal_struct {
573 */ 572 */
574 struct rlimit rlim[RLIM_NLIMITS]; 573 struct rlimit rlim[RLIM_NLIMITS];
575 574
576 /* keep the process-shared keyrings here so that they do the right
577 * thing in threads created with CLONE_THREAD */
578#ifdef CONFIG_KEYS
579 struct key *session_keyring; /* keyring inherited over fork */
580 struct key *process_keyring; /* keyring private to this process */
581#endif
582#ifdef CONFIG_BSD_PROCESS_ACCT 575#ifdef CONFIG_BSD_PROCESS_ACCT
583 struct pacct_struct pacct; /* per-process accounting information */ 576 struct pacct_struct pacct; /* per-process accounting information */
584#endif 577#endif
@@ -649,6 +642,7 @@ struct user_struct {
649 /* Hash table maintenance information */ 642 /* Hash table maintenance information */
650 struct hlist_node uidhash_node; 643 struct hlist_node uidhash_node;
651 uid_t uid; 644 uid_t uid;
645 struct user_namespace *user_ns;
652 646
653#ifdef CONFIG_USER_SCHED 647#ifdef CONFIG_USER_SCHED
654 struct task_group *tg; 648 struct task_group *tg;
@@ -666,6 +660,7 @@ extern struct user_struct *find_user(uid_t);
666extern struct user_struct root_user; 660extern struct user_struct root_user;
667#define INIT_USER (&root_user) 661#define INIT_USER (&root_user)
668 662
663
669struct backing_dev_info; 664struct backing_dev_info;
670struct reclaim_state; 665struct reclaim_state;
671 666
@@ -673,8 +668,7 @@ struct reclaim_state;
673struct sched_info { 668struct sched_info {
674 /* cumulative counters */ 669 /* cumulative counters */
675 unsigned long pcount; /* # of times run on this cpu */ 670 unsigned long pcount; /* # of times run on this cpu */
676 unsigned long long cpu_time, /* time spent on the cpu */ 671 unsigned long long run_delay; /* time spent waiting on a runqueue */
677 run_delay; /* time spent waiting on a runqueue */
678 672
679 /* timestamps */ 673 /* timestamps */
680 unsigned long long last_arrival,/* when we last ran on a cpu */ 674 unsigned long long last_arrival,/* when we last ran on a cpu */
@@ -889,38 +883,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
889#endif /* !CONFIG_SMP */ 883#endif /* !CONFIG_SMP */
890 884
891struct io_context; /* See blkdev.h */ 885struct io_context; /* See blkdev.h */
892#define NGROUPS_SMALL 32
893#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
894struct group_info {
895 int ngroups;
896 atomic_t usage;
897 gid_t small_block[NGROUPS_SMALL];
898 int nblocks;
899 gid_t *blocks[0];
900};
901
902/*
903 * get_group_info() must be called with the owning task locked (via task_lock())
904 * when task != current. The reason being that the vast majority of callers are
905 * looking at current->group_info, which can not be changed except by the
906 * current task. Changing current->group_info requires the task lock, too.
907 */
908#define get_group_info(group_info) do { \
909 atomic_inc(&(group_info)->usage); \
910} while (0)
911 886
912#define put_group_info(group_info) do { \
913 if (atomic_dec_and_test(&(group_info)->usage)) \
914 groups_free(group_info); \
915} while (0)
916
917extern struct group_info *groups_alloc(int gidsetsize);
918extern void groups_free(struct group_info *group_info);
919extern int set_current_groups(struct group_info *group_info);
920extern int groups_search(struct group_info *group_info, gid_t grp);
921/* access the groups "array" with this macro */
922#define GROUP_AT(gi, i) \
923 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
924 887
925#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK 888#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
926extern void prefetch_stack(struct task_struct *t); 889extern void prefetch_stack(struct task_struct *t);
@@ -1167,6 +1130,19 @@ struct task_struct {
1167 struct list_head ptraced; 1130 struct list_head ptraced;
1168 struct list_head ptrace_entry; 1131 struct list_head ptrace_entry;
1169 1132
1133#ifdef CONFIG_X86_PTRACE_BTS
1134 /*
1135 * This is the tracer handle for the ptrace BTS extension.
1136 * This field actually belongs to the ptracer task.
1137 */
1138 struct bts_tracer *bts;
1139 /*
1140 * The buffer to hold the BTS data.
1141 */
1142 void *bts_buffer;
1143 size_t bts_size;
1144#endif /* CONFIG_X86_PTRACE_BTS */
1145
1170 /* PID/PID hash table linkage. */ 1146 /* PID/PID hash table linkage. */
1171 struct pid_link pids[PIDTYPE_MAX]; 1147 struct pid_link pids[PIDTYPE_MAX];
1172 struct list_head thread_group; 1148 struct list_head thread_group;
@@ -1188,17 +1164,12 @@ struct task_struct {
1188 struct list_head cpu_timers[3]; 1164 struct list_head cpu_timers[3];
1189 1165
1190/* process credentials */ 1166/* process credentials */
1191 uid_t uid,euid,suid,fsuid; 1167 const struct cred *real_cred; /* objective and real subjective task
1192 gid_t gid,egid,sgid,fsgid; 1168 * credentials (COW) */
1193 struct group_info *group_info; 1169 const struct cred *cred; /* effective (overridable) subjective task
1194 kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; 1170 * credentials (COW) */
1195 struct user_struct *user; 1171 struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */
1196 unsigned securebits; 1172
1197#ifdef CONFIG_KEYS
1198 unsigned char jit_keyring; /* default keyring to attach requested keys to */
1199 struct key *request_key_auth; /* assumed request_key authority */
1200 struct key *thread_keyring; /* keyring private to this thread */
1201#endif
1202 char comm[TASK_COMM_LEN]; /* executable name excluding path 1173 char comm[TASK_COMM_LEN]; /* executable name excluding path
1203 - access with [gs]et_task_comm (which lock 1174 - access with [gs]et_task_comm (which lock
1204 it with task_lock()) 1175 it with task_lock())
@@ -1235,9 +1206,6 @@ struct task_struct {
1235 int (*notifier)(void *priv); 1206 int (*notifier)(void *priv);
1236 void *notifier_data; 1207 void *notifier_data;
1237 sigset_t *notifier_mask; 1208 sigset_t *notifier_mask;
1238#ifdef CONFIG_SECURITY
1239 void *security;
1240#endif
1241 struct audit_context *audit_context; 1209 struct audit_context *audit_context;
1242#ifdef CONFIG_AUDITSYSCALL 1210#ifdef CONFIG_AUDITSYSCALL
1243 uid_t loginuid; 1211 uid_t loginuid;
@@ -1359,6 +1327,23 @@ struct task_struct {
1359 unsigned long default_timer_slack_ns; 1327 unsigned long default_timer_slack_ns;
1360 1328
1361 struct list_head *scm_work_list; 1329 struct list_head *scm_work_list;
1330#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1331 /* Index of current stored adress in ret_stack */
1332 int curr_ret_stack;
1333 /* Stack of return addresses for return function tracing */
1334 struct ftrace_ret_stack *ret_stack;
1335 /*
1336 * Number of functions that haven't been traced
1337 * because of depth overrun.
1338 */
1339 atomic_t trace_overrun;
1340 /* Pause for the tracing */
1341 atomic_t tracing_graph_pause;
1342#endif
1343#ifdef CONFIG_TRACING
1344 /* state flags for use by tracers */
1345 unsigned long trace;
1346#endif
1362}; 1347};
1363 1348
1364/* 1349/*
@@ -1778,7 +1763,6 @@ static inline struct user_struct *get_uid(struct user_struct *u)
1778 return u; 1763 return u;
1779} 1764}
1780extern void free_uid(struct user_struct *); 1765extern void free_uid(struct user_struct *);
1781extern void switch_uid(struct user_struct *);
1782extern void release_uids(struct user_namespace *ns); 1766extern void release_uids(struct user_namespace *ns);
1783 1767
1784#include <asm/current.h> 1768#include <asm/current.h>
@@ -1797,9 +1781,6 @@ extern void wake_up_new_task(struct task_struct *tsk,
1797extern void sched_fork(struct task_struct *p, int clone_flags); 1781extern void sched_fork(struct task_struct *p, int clone_flags);
1798extern void sched_dead(struct task_struct *p); 1782extern void sched_dead(struct task_struct *p);
1799 1783
1800extern int in_group_p(gid_t);
1801extern int in_egroup_p(gid_t);
1802
1803extern void proc_caches_init(void); 1784extern void proc_caches_init(void);
1804extern void flush_signals(struct task_struct *); 1785extern void flush_signals(struct task_struct *);
1805extern void ignore_signals(struct task_struct *); 1786extern void ignore_signals(struct task_struct *);
@@ -1931,6 +1912,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p,
1931#define for_each_process(p) \ 1912#define for_each_process(p) \
1932 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 1913 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
1933 1914
1915extern bool is_single_threaded(struct task_struct *);
1916
1934/* 1917/*
1935 * Careful: do_each_thread/while_each_thread is a double loop so 1918 * Careful: do_each_thread/while_each_thread is a double loop so
1936 * 'break' will not work as expected - use goto instead. 1919 * 'break' will not work as expected - use goto instead.
@@ -2227,6 +2210,7 @@ extern void normalize_rt_tasks(void);
2227extern struct task_group init_task_group; 2210extern struct task_group init_task_group;
2228#ifdef CONFIG_USER_SCHED 2211#ifdef CONFIG_USER_SCHED
2229extern struct task_group root_task_group; 2212extern struct task_group root_task_group;
2213extern void set_tg_uid(struct user_struct *user);
2230#endif 2214#endif
2231 2215
2232extern struct task_group *sched_create_group(struct task_group *parent); 2216extern struct task_group *sched_create_group(struct task_group *parent);