calculation of ac_mem (in BSD accounting) misleading?

Doug Bagley (doug@bagley.org)
Wed, 30 May 2001 15:27:37 -0500 (CDT)


I'm interested in understanding better why the value of ac_mem in the
BSD process accounting code (linux/kernel/acct.c) is calculated the
way it is. My humble uninformed opinion is that it's current
definition is possibly misleading at best and mostly useless at worst.

As a little background:

The comment in include/linux/acct.h says ac_mem is "Average Memory
Usage".

According to BSD sources, ac_mem in BSD looks like a time-averaged
resident set size:

acct.ac_mem = (r->ru_ixrss + r->ru_idrss + r->ru_isrss) / t;
(http://minnie.tuhs.org/FreeBSD-srctree/newsrc/kern/kern_acct.c.html)

But the code in linux/kernel/acct.c indicates that ac_mem is simply the
vmsize (in KB) at the time acct_process() is called from do_exit(). It
does not appear to be an average, and IMHO, vmsize is nearly useless,
especially if one expects RSS.

Does it make sense to others that ac_mem should be changed to reflect
the resident set size?

Cheers,
Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/