diff options
| author | David S. Miller <davem@davemloft.net> | 2010-04-03 18:49:14 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-03 18:49:14 -0400 |
| commit | 87e8b821ed8db3dab03d96cd542e29666bf210aa (patch) | |
| tree | 0027060473aafbbb125655ba027319c8a1a665fc /include/linux/sched.h | |
| parent | 33cd9dfa3a13e3d8e41aef225a9f98169816723b (diff) | |
| parent | 5e11611a5d22252f3f9c169a3c9377eac0c32033 (diff) | |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 66 |
1 files changed, 8 insertions, 58 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4b1753f7e48e..dad7f668ebf7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -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; |
| @@ -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) |
