mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
sched: Remove task_{u,s,g}time()
Now all task_{u,s}time() pairs are replaced by task_times(). And task_gtime() is too simple to be an inline function. Cleanup them all. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Spencer Candland <spencer@bluehost.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Americo Wang <xiyou.wangcong@gmail.com> LKML-Reference: <4B0E16D1.70902@jp.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d180c5bcce
commit
d5b7c78e97
@ -511,7 +511,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
|
|||||||
do {
|
do {
|
||||||
min_flt += t->min_flt;
|
min_flt += t->min_flt;
|
||||||
maj_flt += t->maj_flt;
|
maj_flt += t->maj_flt;
|
||||||
gtime = cputime_add(gtime, task_gtime(t));
|
gtime = cputime_add(gtime, t->gtime);
|
||||||
t = next_thread(t);
|
t = next_thread(t);
|
||||||
} while (t != task);
|
} while (t != task);
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
|
|||||||
min_flt = task->min_flt;
|
min_flt = task->min_flt;
|
||||||
maj_flt = task->maj_flt;
|
maj_flt = task->maj_flt;
|
||||||
task_times(task, &utime, &stime);
|
task_times(task, &utime, &stime);
|
||||||
gtime = task_gtime(task);
|
gtime = task->gtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scale priority and nice values from timeslices to -20..20 */
|
/* scale priority and nice values from timeslices to -20..20 */
|
||||||
|
@ -1720,9 +1720,6 @@ static inline void put_task_struct(struct task_struct *t)
|
|||||||
__put_task_struct(t);
|
__put_task_struct(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern cputime_t task_utime(struct task_struct *p);
|
|
||||||
extern cputime_t task_stime(struct task_struct *p);
|
|
||||||
extern cputime_t task_gtime(struct task_struct *p);
|
|
||||||
extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -115,7 +115,7 @@ static void __exit_signal(struct task_struct *tsk)
|
|||||||
task_times(tsk, &utime, &stime);
|
task_times(tsk, &utime, &stime);
|
||||||
sig->utime = cputime_add(sig->utime, utime);
|
sig->utime = cputime_add(sig->utime, utime);
|
||||||
sig->stime = cputime_add(sig->stime, stime);
|
sig->stime = cputime_add(sig->stime, stime);
|
||||||
sig->gtime = cputime_add(sig->gtime, task_gtime(tsk));
|
sig->gtime = cputime_add(sig->gtime, tsk->gtime);
|
||||||
sig->min_flt += tsk->min_flt;
|
sig->min_flt += tsk->min_flt;
|
||||||
sig->maj_flt += tsk->maj_flt;
|
sig->maj_flt += tsk->maj_flt;
|
||||||
sig->nvcsw += tsk->nvcsw;
|
sig->nvcsw += tsk->nvcsw;
|
||||||
|
@ -5182,22 +5182,12 @@ void account_idle_ticks(unsigned long ticks)
|
|||||||
* Use precise platform statistics if available:
|
* Use precise platform statistics if available:
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
||||||
cputime_t task_utime(struct task_struct *p)
|
|
||||||
{
|
|
||||||
return p->utime;
|
|
||||||
}
|
|
||||||
|
|
||||||
cputime_t task_stime(struct task_struct *p)
|
|
||||||
{
|
|
||||||
return p->stime;
|
|
||||||
}
|
|
||||||
|
|
||||||
void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
|
void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
|
||||||
{
|
{
|
||||||
if (ut)
|
if (ut)
|
||||||
*ut = task_utime(p);
|
*ut = p->utime;
|
||||||
if (st)
|
if (st)
|
||||||
*st = task_stime(p);
|
*st = p->stime;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -5235,27 +5225,8 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
|
|||||||
if (st)
|
if (st)
|
||||||
*st = p->prev_stime;
|
*st = p->prev_stime;
|
||||||
}
|
}
|
||||||
|
|
||||||
cputime_t task_utime(struct task_struct *p)
|
|
||||||
{
|
|
||||||
cputime_t utime;
|
|
||||||
task_times(p, &utime, NULL);
|
|
||||||
return utime;
|
|
||||||
}
|
|
||||||
|
|
||||||
cputime_t task_stime(struct task_struct *p)
|
|
||||||
{
|
|
||||||
cputime_t stime;
|
|
||||||
task_times(p, NULL, &stime);
|
|
||||||
return stime;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline cputime_t task_gtime(struct task_struct *p)
|
|
||||||
{
|
|
||||||
return p->gtime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function gets called by the timer code, with HZ frequency.
|
* This function gets called by the timer code, with HZ frequency.
|
||||||
* We call it with interrupts disabled.
|
* We call it with interrupts disabled.
|
||||||
|
Loading…
Reference in New Issue
Block a user