diff options
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 70 |
1 files changed, 10 insertions, 60 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0eef87b58ea5..dad7f668ebf7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -97,7 +97,7 @@ struct sched_param { | |||
| 97 | struct exec_domain; | 97 | struct exec_domain; |
| 98 | struct futex_pi_state; | 98 | struct futex_pi_state; |
| 99 | struct robust_list_head; | 99 | struct robust_list_head; |
| 100 | struct bio; | 100 | struct bio_list; |
| 101 | struct fs_struct; | 101 | struct fs_struct; |
| 102 | struct bts_context; | 102 | struct bts_context; |
| 103 | struct perf_event_context; | 103 | struct perf_event_context; |
| @@ -258,6 +258,10 @@ extern spinlock_t mmlist_lock; | |||
| 258 | 258 | ||
| 259 | struct task_struct; | 259 | struct task_struct; |
| 260 | 260 | ||
| 261 | #ifdef CONFIG_PROVE_RCU | ||
| 262 | extern int lockdep_tasklist_lock_is_held(void); | ||
| 263 | #endif /* #ifdef CONFIG_PROVE_RCU */ | ||
| 264 | |||
| 261 | extern void sched_init(void); | 265 | extern void sched_init(void); |
| 262 | extern void sched_init_smp(void); | 266 | extern void sched_init_smp(void); |
| 263 | extern asmlinkage void schedule_tail(struct task_struct *prev); | 267 | extern asmlinkage void schedule_tail(struct task_struct *prev); |
| @@ -396,60 +400,6 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
| 396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | 400 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} |
| 397 | #endif | 401 | #endif |
| 398 | 402 | ||
| 399 | #if USE_SPLIT_PTLOCKS | ||
| 400 | /* | ||
| 401 | * The mm counters are not protected by its page_table_lock, | ||
| 402 | * so must be incremented atomically. | ||
| 403 | */ | ||
| 404 | #define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value) | ||
| 405 | #define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member)) | ||
| 406 | #define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member) | ||
| 407 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) | ||
| 408 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) | ||
| 409 | |||
| 410 | #else /* !USE_SPLIT_PTLOCKS */ | ||
| 411 | /* | ||
| 412 | * The mm counters are protected by its page_table_lock, | ||
| 413 | * so can be incremented directly. | ||
| 414 | */ | ||
| 415 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) | ||
| 416 | #define get_mm_counter(mm, member) ((mm)->_##member) | ||
| 417 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) | ||
| 418 | #define inc_mm_counter(mm, member) (mm)->_##member++ | ||
| 419 | #define dec_mm_counter(mm, member) (mm)->_##member-- | ||
| 420 | |||
| 421 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
| 422 | |||
| 423 | #define get_mm_rss(mm) \ | ||
| 424 | (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) | ||
| 425 | #define update_hiwater_rss(mm) do { \ | ||
| 426 | unsigned long _rss = get_mm_rss(mm); \ | ||
| 427 | if ((mm)->hiwater_rss < _rss) \ | ||
| 428 | (mm)->hiwater_rss = _rss; \ | ||
| 429 | } while (0) | ||
| 430 | #define update_hiwater_vm(mm) do { \ | ||
| 431 | if ((mm)->hiwater_vm < (mm)->total_vm) \ | ||
| 432 | (mm)->hiwater_vm = (mm)->total_vm; \ | ||
| 433 | } while (0) | ||
| 434 | |||
| 435 | static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | ||
| 436 | { | ||
| 437 | return max(mm->hiwater_rss, get_mm_rss(mm)); | ||
| 438 | } | ||
| 439 | |||
| 440 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
| 441 | struct mm_struct *mm) | ||
| 442 | { | ||
| 443 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
| 444 | |||
| 445 | if (*maxrss < hiwater_rss) | ||
| 446 | *maxrss = hiwater_rss; | ||
| 447 | } | ||
| 448 | |||
| 449 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | ||
| 450 | { | ||
| 451 | return max(mm->hiwater_vm, mm->total_vm); | ||
| 452 | } | ||
| 453 | 403 | ||
| 454 | extern void set_dumpable(struct mm_struct *mm, int value); | 404 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 455 | extern int get_dumpable(struct mm_struct *mm); | 405 | extern int get_dumpable(struct mm_struct *mm); |
| @@ -1274,7 +1224,9 @@ struct task_struct { | |||
| 1274 | struct plist_node pushable_tasks; | 1224 | struct plist_node pushable_tasks; |
| 1275 | 1225 | ||
| 1276 | struct mm_struct *mm, *active_mm; | 1226 | struct mm_struct *mm, *active_mm; |
| 1277 | 1227 | #if defined(SPLIT_RSS_COUNTING) | |
| 1228 | struct task_rss_stat rss_stat; | ||
| 1229 | #endif | ||
| 1278 | /* task state */ | 1230 | /* task state */ |
| 1279 | int exit_state; | 1231 | int exit_state; |
| 1280 | int exit_code, exit_signal; | 1232 | int exit_code, exit_signal; |
| @@ -1454,7 +1406,7 @@ struct task_struct { | |||
| 1454 | void *journal_info; | 1406 | void *journal_info; |
| 1455 | 1407 | ||
| 1456 | /* stacked block device info */ | 1408 | /* stacked block device info */ |
| 1457 | struct bio *bio_list, **bio_tail; | 1409 | struct bio_list *bio_list; |
| 1458 | 1410 | ||
| 1459 | /* VM state */ | 1411 | /* VM state */ |
| 1460 | struct reclaim_state *reclaim_state; | 1412 | struct reclaim_state *reclaim_state; |
| @@ -1525,7 +1477,7 @@ struct task_struct { | |||
| 1525 | 1477 | ||
| 1526 | struct list_head *scm_work_list; | 1478 | struct list_head *scm_work_list; |
| 1527 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 1479 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 1528 | /* Index of current stored adress in ret_stack */ | 1480 | /* Index of current stored address in ret_stack */ |
| 1529 | int curr_ret_stack; | 1481 | int curr_ret_stack; |
| 1530 | /* Stack of return addresses for return function tracing */ | 1482 | /* Stack of return addresses for return function tracing */ |
| 1531 | struct ftrace_ret_stack *ret_stack; | 1483 | struct ftrace_ret_stack *ret_stack; |
| @@ -2443,9 +2395,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); | |||
| 2443 | 2395 | ||
| 2444 | static inline void thread_group_cputime_init(struct signal_struct *sig) | 2396 | static inline void thread_group_cputime_init(struct signal_struct *sig) |
| 2445 | { | 2397 | { |
| 2446 | sig->cputimer.cputime = INIT_CPUTIME; | ||
| 2447 | spin_lock_init(&sig->cputimer.lock); | 2398 | spin_lock_init(&sig->cputimer.lock); |
| 2448 | sig->cputimer.running = 0; | ||
| 2449 | } | 2399 | } |
| 2450 | 2400 | ||
| 2451 | static inline void thread_group_cputime_free(struct signal_struct *sig) | 2401 | static inline void thread_group_cputime_free(struct signal_struct *sig) |
