diff options
| author | Jay Lan <jlan@engr.sgi.com> | 2005-01-04 05:25:39 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:25:39 -0800 |
| commit | b6a6107abf22149c9cedc68149d3fd78a76f7e34 (patch) | |
| tree | de3c6674a0693dbfce15bfee0e59ce4f66ffc879 /include/linux | |
| parent | 9ca7d6f6cdc862fdebc72c4c15249cbb729a2f0f (diff) | |
[PATCH] enhanced Memory accounting data collection
This patch is to offer common accounting data collection method at memory
usage for various accounting packages including BSD accounting, ELSA, CSA
and any other acct packages that use a common layer of data collection.
New struct fields are added to mm_struct to save high watermarks of rss
usage as well as virtual memory usage.
New struct fields are added to task_struct to collect accumulated rss usage
and vm usages.
These data are collected on per process basis.
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/linux')
| -rw-r--r-- | include/linux/acct.h | 4 | ||||
| -rw-r--r-- | include/linux/mm.h | 3 | ||||
| -rw-r--r-- | include/linux/sched.h | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index a6ab17c49aa1..39cd52f7f557 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -120,9 +120,13 @@ 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_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_clear_integrals(task) do { } while (0) #endif /* diff --git a/include/linux/mm.h b/include/linux/mm.h index e1b1fe113129..d3b4c6804c18 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -833,6 +833,9 @@ static inline void vm_stat_unaccount(struct vm_area_struct *vma) -vma_pages(vma)); } +/* update per process rss and vm hiwater data */ +extern void update_mem_hiwater(void); + #ifndef CONFIG_DEBUG_PAGEALLOC static inline void kernel_map_pages(struct page *page, int numpages, int enable) diff --git a/include/linux/sched.h b/include/linux/sched.h index 558d5733a0aa..848a48b1da8b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -250,6 +250,9 @@ struct mm_struct { struct kioctx *ioctx_list; struct kioctx default_kioctx; + + unsigned long hiwater_rss; /* High-water RSS usage */ + unsigned long hiwater_vm; /* High-water virtual memory usage */ }; struct sighand_struct { @@ -662,6 +665,11 @@ struct task_struct { wait_queue_t *io_wait; /* i/o counters(bytes read/written, #syscalls */ u64 rchar, wchar, syscr, syscw; +#if defined(CONFIG_BSD_PROCESS_ACCT) + u64 acct_rss_mem1; /* accumulated rss usage */ + u64 acct_vm_mem1; /* accumulated virtual memory usage */ + clock_t acct_stimexpd; /* clock_t-converted stime since last update */ +#endif #ifdef CONFIG_NUMA struct mempolicy *mempolicy; short il_next; /* could be shared with used_math */ |
