Merge branch 'linus' into core/percpu
Conflicts: arch/x86/kernel/setup_percpu.c
This commit is contained in:
commit
3ddeb51d9c
944 changed files with 12560 additions and 5881 deletions
|
|
@ -293,6 +293,9 @@ extern void sched_show_task(struct task_struct *p);
|
|||
extern void softlockup_tick(void);
|
||||
extern void touch_softlockup_watchdog(void);
|
||||
extern void touch_all_softlockup_watchdogs(void);
|
||||
extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
|
||||
struct file *filp, void __user *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
extern unsigned int softlockup_panic;
|
||||
extern unsigned long sysctl_hung_task_check_count;
|
||||
extern unsigned long sysctl_hung_task_timeout_secs;
|
||||
|
|
@ -450,6 +453,7 @@ struct task_cputime {
|
|||
cputime_t utime;
|
||||
cputime_t stime;
|
||||
unsigned long long sum_exec_runtime;
|
||||
spinlock_t lock;
|
||||
};
|
||||
/* Alternate field names when used to cache expirations. */
|
||||
#define prof_exp stime
|
||||
|
|
@ -465,7 +469,7 @@ struct task_cputime {
|
|||
* used for thread group CPU clock calculations.
|
||||
*/
|
||||
struct thread_group_cputime {
|
||||
struct task_cputime *totals;
|
||||
struct task_cputime totals;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -2192,24 +2196,30 @@ static inline int spin_needbreak(spinlock_t *lock)
|
|||
* Thread group CPU time accounting.
|
||||
*/
|
||||
|
||||
extern int thread_group_cputime_alloc(struct task_struct *);
|
||||
extern void thread_group_cputime(struct task_struct *, struct task_cputime *);
|
||||
static inline
|
||||
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
|
||||
{
|
||||
struct task_cputime *totals = &tsk->signal->cputime.totals;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&totals->lock, flags);
|
||||
*times = *totals;
|
||||
spin_unlock_irqrestore(&totals->lock, flags);
|
||||
}
|
||||
|
||||
static inline void thread_group_cputime_init(struct signal_struct *sig)
|
||||
{
|
||||
sig->cputime.totals = NULL;
|
||||
}
|
||||
sig->cputime.totals = (struct task_cputime){
|
||||
.utime = cputime_zero,
|
||||
.stime = cputime_zero,
|
||||
.sum_exec_runtime = 0,
|
||||
};
|
||||
|
||||
static inline int thread_group_cputime_clone_thread(struct task_struct *curr)
|
||||
{
|
||||
if (curr->signal->cputime.totals)
|
||||
return 0;
|
||||
return thread_group_cputime_alloc(curr);
|
||||
spin_lock_init(&sig->cputime.totals.lock);
|
||||
}
|
||||
|
||||
static inline void thread_group_cputime_free(struct signal_struct *sig)
|
||||
{
|
||||
free_percpu(sig->cputime.totals);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue