diff options
| author | Christoph Lameter <clameter@sgi.com> | 2005-03-04 17:26:24 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-04 17:26:24 -0800 |
| commit | 545a604c163b11bc625e7d031dbe1c02a520d6d6 (patch) | |
| tree | 00006b583414da3a39e1669dd5b8b438dbbb64ff /kernel/acct.c | |
| parent | bf57909ff72b7e1481b38590edd036c1ef5991e9 (diff) | |
[PATCH] Move accounting function calls out of critical vm code paths
In the 2.6.11 development cycle function calls have been added to lots
of hot vm paths to do accounting. I think these should not go into the
final 2.6.1 release because these statistics can be collected in a different
way that does not require the updating of counters from frequently used
vm code paths and is consistent with the methods use elsewhere in the kernel
to obtain statistics.
These function calls are
acct_update_integrals -> Account for processes based on stime changes
update_mem_hiwater -> takes rss and total_vm hiwater marks.
acct_update_integrals is only useful to call if stime changes otherwise
it will simply return. It is therefore best to relocate the function call
to acct_update_integral into the function that updates stime which is
account_system_time and remove it from the vm code paths.
update_mem_hiwater finds the rss hiwater mark. We call that from timer
context as well. This means that processes' high-water marks are now
sampled statistically, at timer-interrupt time rather than
deterministically. This may or may not be a problem..
This means that the rss limit is not always updated if rss is increased
and thus not as accurate. But the benefit is that the rss checks do no
pollute the vm paths and that it is consistent with the rss limit check.
The following patch removes acct_update_integrals and update_mem_hiwater
from the hot vm paths.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
From: Jay Lan <jlan@sgi.com>
The new "move-accounting-function-calls-out-of-critical-vm-code-paths"
patch in 2.6.11-rc3-mm2 was different from the code i tested.
In particular, it mistakenly dropped the accounting routine calls
in fs/exec.c. The calls in do_execve() are needed to properly
initialize accounting fields. Specifically, the tsk->acct_stimexpd
needs to be initialized to tsk->stime.
I have discussed this with Christoph Lameter and he gave me full
blessings to bring the calls back.
Signed-off-by: Jay Lan <jlan@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/acct.c')
| -rw-r--r-- | kernel/acct.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index 32e39accbb86..78ed87b13de6 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -534,10 +534,8 @@ void acct_process(long exitcode) * acct_update_integrals * - update mm integral fields in task_struct */ -void acct_update_integrals(void) +void acct_update_integrals(struct task_struct *tsk) { - struct task_struct *tsk = current; - if (likely(tsk->mm)) { long delta = tsk->stime - tsk->acct_stimexpd; |
