Re: More questions about 2.6 /proc/meminfo was: (Mem: and Swap: lines in /proc/meminfo)

From: Mike Fedyk
Date: Mon Dec 15 2003 - 16:59:40 EST


On Mon, Dec 15, 2003 at 05:40:10PM -0200, edjard@xxxxxxxxxxx wrote:
> Some days ago we sent this patch for 2.6.0-test11, which gives some useful
> information regarding these data you are requesting.
>
> We are now changing this patch to provide the data you require. No body
> answered so far if this is ok to be done by the kernel. We did not to
> try to implement it as a module yet.
>

OK, interesting. I have some questions below.

> buffer += sprintf(buffer,
> "VmSize:\t%8lu kB\n"
> "VmLck:\t%8lu kB\n"
> "VmRSS:\t%8lu kB\n"
> "VmData:\t%8lu kB\n"
> + "RssData:\t%8lu kB\n"
> "VmStk:\t%8lu kB\n"
> + "RssStk:\t%8lu kB\n"
> "VmExe:\t%8lu kB\n"
> - "VmLib:\t%8lu kB\n",
> + "RssExe:\t%8lu kB\n"
> + "VmLib:\t%8lu kB\n"
> + "RssLib:\t%8lu kB\n"
> + "VmHeap:\t%8lu KB\n"
> + "RssHeap:\t%8lu KB\n",
> mm->total_vm << (PAGE_SHIFT-10),
> mm->locked_vm << (PAGE_SHIFT-10),
> mm->rss << (PAGE_SHIFT-10),
> - data - stack, stack,
> - exec - lib, lib);
> + data - stack, (phys_data - phys_stack) >> 10,
> + stack, phys_stack >> 10,
> + exec - lib, (phys_exec - phys_lib) >> 10,
> + lib, phys_lib >> 10,
> + (mm->brk - mm->start_brk) >> 10, phys_brk >> 10);
> up_read(&mm->mmap_sem);
> return buffer;
> }

Kernels without this patch, I'd have to take VmRSS and calculate that
against VmLib, and then have to think about shared memory between threads
and I'm not sure what else.

If I want to get the memory used by all apps from /proc/$pid/status, how am
I going to calculate it with this patch, and how will it be more accurate
from what I'd have to deal with from 2.[246] as they currently are without
the patch?

Thanks,

Mike
-
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/