Re: [patch 3/3] convert CONFIG tag for extended accounting routines

From: Jay Lan
Date: Mon Aug 07 2006 - 22:11:02 EST


Jay Lan wrote:
Andrew Morton wrote:


[snip]


+ if (delta == 0)
+ return;
+ tsk->acct_stimexpd = tsk->stime;
+ tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
+ tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;



It's a bit weird to be multiplying RSS by time. What unit is a "byte
second"?

If this is not a bug then I guess this is an intermediate term for
additional downstream processing. There is information loss here and I'd
have thought that it would be better to simply send `delta' and the rss
straight to userspace, let userspace work out what math it wants to perform
on it. If that makes sense?

I see that the code has been like this for a long time, so treat this as a
"please educate me about BSD accounting" email ;)


This is not a BSD accounting thing. It came from UNICOS and IRIX.
I am pinging the person who knows how the real world users use these
two fields...

Andrew,

Here is the explanation i owe you.

We accumulated the RSS/VM value at each timer interrupt update in terms
of pages-tick. At userland, the value is divided by tsk->stime (in usec)
to gain average usage of RSS/VM.

I need to do a little bit more processing in the kernel to convert
the pages-tick values to Mbytes-usec unit before delivery to userland
since the calculation are platform dependent. I will include the
change in the upcoming update patch.

Regards,
- jay



Regards,
- jay





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