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 /include | |
| 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 'include')
| -rw-r--r-- | include/linux/acct.h | 4 | ||||
| -rw-r--r-- | include/linux/mm.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 39cd52f7f557..1993a3691768 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -120,12 +120,12 @@ struct acct_v3 struct super_block; extern void acct_auto_close(struct super_block *sb); extern void acct_process(long exitcode); -extern void acct_update_integrals(void); +extern void acct_update_integrals(struct task_struct *tsk); extern void acct_clear_integrals(struct task_struct *tsk); #else #define acct_auto_close(x) do { } while (0) #define acct_process(x) do { } while (0) -#define acct_update_integrals() do { } while (0) +#define acct_update_integrals(x) do { } while (0) #define acct_clear_integrals(task) do { } while (0) #endif diff --git a/include/linux/mm.h b/include/linux/mm.h index 3a8c47c5dc9c..418b928a6617 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -838,7 +838,7 @@ static inline void vm_stat_unaccount(struct vm_area_struct *vma) } /* update per process rss and vm hiwater data */ -extern void update_mem_hiwater(void); +extern void update_mem_hiwater(struct task_struct *tsk); #ifndef CONFIG_DEBUG_PAGEALLOC static inline void |
