aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorHidetoshi Seto <[email protected]>2009-11-26 05:48:30 +0000
committerIngo Molnar <[email protected]>2009-11-26 11:59:19 +0000
commitd180c5bccec02612256fd8076ff3c1fac3429553 (patch)
tree1ef4a45c81531645640380965916c68bbe7f6abb /fs/proc/array.c
parentMerge branch 'sched/urgent' into sched/core (diff)
downloadkernel-d180c5bccec02612256fd8076ff3c1fac3429553.tar.gz
kernel-d180c5bccec02612256fd8076ff3c1fac3429553.zip
sched: Introduce task_times() to replace task_{u,s}time() pair
Functions task_{u,s}time() are called in pair in almost all cases. However task_stime() is implemented to call task_utime() from its inside, so such paired calls run task_utime() twice. It means we do heavy divisions (div_u64 + do_div) twice to get utime and stime which can be obtained at same time by one set of divisions. This patch introduces a function task_times(*tsk, *utime, *stime) to retrieve utime and stime at once in better, optimized way. Signed-off-by: Hidetoshi Seto <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Stanislaw Gruszka <[email protected]> Cc: Spencer Candland <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Americo Wang <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index e209f64ab27b..330deda70d08 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -535,8 +535,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
if (!whole) {
min_flt = task->min_flt;
maj_flt = task->maj_flt;
- utime = task_utime(task);
- stime = task_stime(task);
+ task_times(task, &utime, &stime);
gtime = task_gtime(task);
}