diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-02-05 06:24:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-05 07:04:33 -0500 |
commit | 4cd4c1b40d40447fb5e7ba80746c6d7ba91d7a53 (patch) | |
tree | b1e580d5284648d6884e951d995509094a92cca4 /include/linux/init_task.h | |
parent | 32bd671d6cbeda60dc73be77fa2b9037d9a9bfa0 (diff) |
timers: split process wide cpu clocks/timers
Change the process wide cpu timers/clocks so that we:
1) don't mess up the kernel with too many threads,
2) don't have a per-cpu allocation for each process,
3) have no impact when not used.
In order to accomplish this we're going to split it into two parts:
- clocks; which can take all the time they want since they run
from user context -- ie. sys_clock_gettime(CLOCK_PROCESS_CPUTIME_ID)
- timers; which need constant time sampling but since they're
explicity used, the user can pay the overhead.
The clock readout will go back to a full sum of the thread group, while the
timers will run of a global 'clock' that only runs when needed, so only
programs that make use of the facility pay the price.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/init_task.h')
-rw-r--r-- | include/linux/init_task.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index ea0ea1a4c36f..e752d973fa21 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -48,12 +48,11 @@ extern struct fs_struct init_fs; | |||
48 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 48 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
49 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 49 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
50 | .rlim = INIT_RLIMITS, \ | 50 | .rlim = INIT_RLIMITS, \ |
51 | .cputime = { .totals = { \ | 51 | .cputimer = { \ |
52 | .utime = cputime_zero, \ | 52 | .cputime = INIT_CPUTIME, \ |
53 | .stime = cputime_zero, \ | 53 | .running = 0, \ |
54 | .sum_exec_runtime = 0, \ | 54 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ |
55 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputime.totals.lock), \ | 55 | }, \ |
56 | }, }, \ | ||
57 | } | 56 | } |
58 | 57 | ||
59 | extern struct nsproxy init_nsproxy; | 58 | extern struct nsproxy init_nsproxy; |