The patch titled csa: Extended system accounting over taskstats has been added to the -mm tree. Its filename is csa-extended-system-accounting-over-taskstats.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: csa: Extended system accounting over taskstats From: Jay Lan <jlan@xxxxxxxxxxxx> Add extended system accounting handling over taskstats interface. A CONFIG_TASK_XACCT flag is created to enable the extended accounting code. Signed-off-by: Jay Lan <jlan@xxxxxxx> Cc: Shailabh Nagar <nagar@xxxxxxxxxxxxxx> Cc: Balbir Singh <balbir@xxxxxxxxxx> Cc: Jes Sorensen <jes@xxxxxxx> Cc: Chris Sturtivant <csturtiv@xxxxxxx> Cc: Tony Ernst <tee@xxxxxxx> Cc: Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/taskstats.h | 11 +++++++++++ include/linux/tsacct_kern.h | 9 +++++++++ init/Kconfig | 9 +++++++++ kernel/taskstats.c | 4 ++++ kernel/tsacct.c | 19 +++++++++++++++++++ 5 files changed, 52 insertions(+) diff -puN include/linux/taskstats.h~csa-extended-system-accounting-over-taskstats include/linux/taskstats.h --- a/include/linux/taskstats.h~csa-extended-system-accounting-over-taskstats +++ a/include/linux/taskstats.h @@ -107,6 +107,17 @@ struct taskstats { __u64 ac_minflt; /* Minor Page Fault */ __u64 ac_majflt; /* Major Page Fault */ /* Basic Accounting Fields end */ + + /* Extended accounting fields start */ + __u64 acct_rss_mem1; /* accumulated rss usage */ + __u64 acct_vm_mem1; /* accumulated virtual memory usage */ + __u64 hiwater_rss; /* High-watermark of RSS usage */ + __u64 hiwater_vm; /* High-water virtual memory usage */ + __u64 read_char; /* bytes read */ + __u64 write_char; /* bytes written */ + __u64 read_syscalls; /* read syscalls */ + __u64 write_syscalls; /* write syscalls */ + /* Extended accounting fields end */ }; diff -puN include/linux/tsacct_kern.h~csa-extended-system-accounting-over-taskstats include/linux/tsacct_kern.h --- a/include/linux/tsacct_kern.h~csa-extended-system-accounting-over-taskstats +++ a/include/linux/tsacct_kern.h @@ -16,4 +16,13 @@ static inline void bacct_add_tsk(struct {} #endif /* CONFIG_TASKSTATS */ +#ifdef CONFIG_TASK_XACCT +extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p); +#else +static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) +{} +#endif /* CONFIG_TASK_XACCT */ + #endif + + diff -puN init/Kconfig~csa-extended-system-accounting-over-taskstats init/Kconfig --- a/init/Kconfig~csa-extended-system-accounting-over-taskstats +++ a/init/Kconfig @@ -182,6 +182,15 @@ config TASK_DELAY_ACCT Say N if unsure. +config TASK_XACCT + bool "Enable extended accounting over taskstats (EXPERIMENTAL)" + depends on TASKSTATS + help + Collect extended task accounting data and send the data + to userland for processing over the taskstats interface. + + Say N if unsure. + config SYSCTL bool diff -puN kernel/taskstats.c~csa-extended-system-accounting-over-taskstats kernel/taskstats.c --- a/kernel/taskstats.c~csa-extended-system-accounting-over-taskstats +++ a/kernel/taskstats.c @@ -20,6 +20,7 @@ #include <linux/taskstats_kern.h> #include <linux/tsacct_kern.h> #include <linux/delayacct.h> +#include <linux/tsacct_kern.h> #include <linux/cpumask.h> #include <linux/percpu.h> #include <net/genetlink.h> @@ -204,6 +205,9 @@ static int fill_pid(pid_t pid, struct ta stats->version = TASKSTATS_VERSION; bacct_add_tsk(stats, tsk); + /* fill in extended acct fields */ + xacct_add_tsk(stats, tsk); + /* Define err: label here if needed */ put_task_struct(tsk); return rc; diff -puN kernel/tsacct.c~csa-extended-system-accounting-over-taskstats kernel/tsacct.c --- a/kernel/tsacct.c~csa-extended-system-accounting-over-taskstats +++ a/kernel/tsacct.c @@ -67,3 +67,22 @@ void bacct_add_tsk(struct taskstats *sta strncpy(stats->ac_comm, tsk->comm, sizeof(stats->ac_comm)); } + +#ifdef CONFIG_TASK_XACCT +/* + * fill in extended accounting fields + */ +void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) +{ + stats->acct_rss_mem1 = p->acct_rss_mem1; + stats->acct_vm_mem1 = p->acct_vm_mem1; + if (p->mm) { + stats->hiwater_rss = p->mm->hiwater_rss; + stats->hiwater_vm = p->mm->hiwater_vm; + } + stats->read_char = p->rchar; + stats->write_char = p->wchar; + stats->read_syscalls = p->syscr; + stats->write_syscalls = p->syscw; +} +#endif _ Patches currently in -mm which might be from jlan@xxxxxxxxxxxx are csa-basic-accounting-over-taskstats.patch csa-extended-system-accounting-over-taskstats.patch csa-convert-config-tag-for-extended-accounting-routines.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html