Messages in this thread Patch in this message | | | Date | Mon, 30 Nov 2009 18:20:05 +0900 | From | Hidetoshi Seto <> | Subject | [PATCH 1/2] cputime: remove prev_{u,s}time if VIRT_CPU_ACCOUNTING |
| |
They are used in task_times(), only when !VIRT_CPU_ACCOUNTING. Add ifndef-endif for them.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> --- include/linux/sched.h | 2 ++ kernel/fork.c | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0395b0f..dff85e5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1331,7 +1331,9 @@ struct task_struct { cputime_t utime, stime, utimescaled, stimescaled; cputime_t gtime; +#ifndef CONFIG_VIRT_CPU_ACCOUNTING cputime_t prev_utime, prev_stime; +#endif unsigned long nvcsw, nivcsw; /* context switch counts */ struct timespec start_time; /* monotonic time */ struct timespec real_start_time; /* boot based time */ diff --git a/kernel/fork.c b/kernel/fork.c index 166b8c4..ad7cb6d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1066,8 +1066,10 @@ static struct task_struct *copy_process(unsigned long clone_flags, p->gtime = cputime_zero; p->utimescaled = cputime_zero; p->stimescaled = cputime_zero; +#ifndef CONFIG_VIRT_CPU_ACCOUNTING p->prev_utime = cputime_zero; p->prev_stime = cputime_zero; +#endif p->default_timer_slack_ns = current->timer_slack_ns; -- 1.6.5.3
| |