diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4cae9b81a1f8..5a7c76388731 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -293,6 +293,9 @@ extern void sched_show_task(struct task_struct *p); | |||
293 | extern void softlockup_tick(void); | 293 | extern void softlockup_tick(void); |
294 | extern void touch_softlockup_watchdog(void); | 294 | extern void touch_softlockup_watchdog(void); |
295 | extern void touch_all_softlockup_watchdogs(void); | 295 | extern void touch_all_softlockup_watchdogs(void); |
296 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | ||
297 | struct file *filp, void __user *buffer, | ||
298 | size_t *lenp, loff_t *ppos); | ||
296 | extern unsigned int softlockup_panic; | 299 | extern unsigned int softlockup_panic; |
297 | extern unsigned long sysctl_hung_task_check_count; | 300 | extern unsigned long sysctl_hung_task_check_count; |
298 | extern unsigned long sysctl_hung_task_timeout_secs; | 301 | extern unsigned long sysctl_hung_task_timeout_secs; |
@@ -450,6 +453,7 @@ struct task_cputime { | |||
450 | cputime_t utime; | 453 | cputime_t utime; |
451 | cputime_t stime; | 454 | cputime_t stime; |
452 | unsigned long long sum_exec_runtime; | 455 | unsigned long long sum_exec_runtime; |
456 | spinlock_t lock; | ||
453 | }; | 457 | }; |
454 | /* Alternate field names when used to cache expirations. */ | 458 | /* Alternate field names when used to cache expirations. */ |
455 | #define prof_exp stime | 459 | #define prof_exp stime |
@@ -465,7 +469,7 @@ struct task_cputime { | |||
465 | * used for thread group CPU clock calculations. | 469 | * used for thread group CPU clock calculations. |
466 | */ | 470 | */ |
467 | struct thread_group_cputime { | 471 | struct thread_group_cputime { |
468 | struct task_cputime *totals; | 472 | struct task_cputime totals; |
469 | }; | 473 | }; |
470 | 474 | ||
471 | /* | 475 | /* |
@@ -626,7 +630,6 @@ struct user_struct { | |||
626 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ | 630 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ |
627 | #endif | 631 | #endif |
628 | #ifdef CONFIG_EPOLL | 632 | #ifdef CONFIG_EPOLL |
629 | atomic_t epoll_devs; /* The number of epoll descriptors currently open */ | ||
630 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 633 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ |
631 | #endif | 634 | #endif |
632 | #ifdef CONFIG_POSIX_MQUEUE | 635 | #ifdef CONFIG_POSIX_MQUEUE |
@@ -2180,24 +2183,30 @@ static inline int spin_needbreak(spinlock_t *lock) | |||
2180 | * Thread group CPU time accounting. | 2183 | * Thread group CPU time accounting. |
2181 | */ | 2184 | */ |
2182 | 2185 | ||
2183 | extern int thread_group_cputime_alloc(struct task_struct *); | 2186 | static inline |
2184 | extern void thread_group_cputime(struct task_struct *, struct task_cputime *); | 2187 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) |
2185 | |||
2186 | static inline void thread_group_cputime_init(struct signal_struct *sig) | ||
2187 | { | 2188 | { |
2188 | sig->cputime.totals = NULL; | 2189 | struct task_cputime *totals = &tsk->signal->cputime.totals; |
2190 | unsigned long flags; | ||
2191 | |||
2192 | spin_lock_irqsave(&totals->lock, flags); | ||
2193 | *times = *totals; | ||
2194 | spin_unlock_irqrestore(&totals->lock, flags); | ||
2189 | } | 2195 | } |
2190 | 2196 | ||
2191 | static inline int thread_group_cputime_clone_thread(struct task_struct *curr) | 2197 | static inline void thread_group_cputime_init(struct signal_struct *sig) |
2192 | { | 2198 | { |
2193 | if (curr->signal->cputime.totals) | 2199 | sig->cputime.totals = (struct task_cputime){ |
2194 | return 0; | 2200 | .utime = cputime_zero, |
2195 | return thread_group_cputime_alloc(curr); | 2201 | .stime = cputime_zero, |
2202 | .sum_exec_runtime = 0, | ||
2203 | }; | ||
2204 | |||
2205 | spin_lock_init(&sig->cputime.totals.lock); | ||
2196 | } | 2206 | } |
2197 | 2207 | ||
2198 | static inline void thread_group_cputime_free(struct signal_struct *sig) | 2208 | static inline void thread_group_cputime_free(struct signal_struct *sig) |
2199 | { | 2209 | { |
2200 | free_percpu(sig->cputime.totals); | ||
2201 | } | 2210 | } |
2202 | 2211 | ||
2203 | /* | 2212 | /* |