aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2009-11-26 00:49:05 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-26 06:59:20 -0500
commitd5b7c78e975302a1bab28263266c39ecb71acad4 (patch)
tree47d9a18b2e81b3f93faf89b548b50beff29dd4fe /kernel
parentd180c5bccec02612256fd8076ff3c1fac3429553 (diff)
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/sched.c33
2 files changed, 3 insertions, 32 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 29068ab2670a..2eaf68b634e3 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -115,7 +115,7 @@ static void __exit_signal(struct task_struct *tsk)
115 task_times(tsk, &utime, &stime); 115 task_times(tsk, &utime, &stime);
116 sig->utime = cputime_add(sig->utime, utime); 116 sig->utime = cputime_add(sig->utime, utime);
117 sig->stime = cputime_add(sig->stime, stime); 117 sig->stime = cputime_add(sig->stime, stime);
118 sig->gtime = cputime_add(sig->gtime, task_gtime(tsk)); 118 sig->gtime = cputime_add(sig->gtime, tsk->gtime);
119 sig->min_flt += tsk->min_flt; 119 sig->min_flt += tsk->min_flt;
120 sig->maj_flt += tsk->maj_flt; 120 sig->maj_flt += tsk->maj_flt;
121 sig->nvcsw += tsk->nvcsw; 121 sig->nvcsw += tsk->nvcsw;
diff --git a/kernel/sched.c b/kernel/sched.c
index 475a6f2b7158..82251c21f785 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5182,22 +5182,12 @@ void account_idle_ticks(unsigned long ticks)
5182 * Use precise platform statistics if available: 5182 * Use precise platform statistics if available:
5183 */ 5183 */
5184#ifdef CONFIG_VIRT_CPU_ACCOUNTING 5184#ifdef CONFIG_VIRT_CPU_ACCOUNTING
5185cputime_t task_utime(struct task_struct *p)
5186{
5187 return p->utime;
5188}
5189
5190cputime_t task_stime(struct task_struct *p)
5191{
5192 return p->stime;
5193}
5194
5195void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st) 5185void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5196{ 5186{
5197 if (ut) 5187 if (ut)
5198 *ut = task_utime(p); 5188 *ut = p->utime;
5199 if (st) 5189 if (st)
5200 *st = task_stime(p); 5190 *st = p->stime;
5201} 5191}
5202#else 5192#else
5203 5193
@@ -5235,27 +5225,8 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5235 if (st) 5225 if (st)
5236 *st = p->prev_stime; 5226 *st = p->prev_stime;
5237} 5227}
5238
5239cputime_t task_utime(struct task_struct *p)
5240{
5241 cputime_t utime;
5242 task_times(p, &utime, NULL);
5243 return utime;
5244}
5245
5246cputime_t task_stime(struct task_struct *p)
5247{
5248 cputime_t stime;
5249 task_times(p, NULL, &stime);
5250 return stime;
5251}
5252#endif 5228#endif
5253 5229
5254inline cputime_t task_gtime(struct task_struct *p)
5255{
5256 return p->gtime;
5257}
5258
5259/* 5230/*
5260 * This function gets called by the timer code, with HZ frequency. 5231 * This function gets called by the timer code, with HZ frequency.
5261 * We call it with interrupts disabled. 5232 * We call it with interrupts disabled.