Inconsistancies in /proc (status vs statm) leading to wrong documentation (proc.txt)

Eric Valette
2004-10-09T09:54:36Z

Hi,

I'm currently trying use mlockall for a soft RT application and was
concerned by the memory usage of my (big) RT process. So I stated to
look at /proc/<PID>/status and /proc/<PID>/statm and then to the
documentation of statm (Documentation/filesystem/proc.txt) because
unexplained values are rather useless.

The doc currently says :
-------------------------------------------------------------------------
Field Content
size total program size (pages) (same as VmSize in status)
resident size of memory portions (pages) (same as VmRSS in status)
shared number of pages that are shared (i.e. backed by a file)
trs number of pages that are 'code' (not including libs; broken,
includes data segment)
lrs number of pages of library (always 0 on 2.6)
drs number of pages of data/stack (including libs; broken,
includes library text)
dt number of dirty pages (always 0 on 2.6)
---------------------------------------------------------------------------

But when I did cat /proc/<pid>/status and /proc/<pid>/statm the result
where rather different (and not only due to size units). Looking at
/usr/src/linux/fs/proc/task_mmu.c It is not surpising.

May I suggest :
- To use consistent memory size units between status and statm,
- To have VmSize and statm return the same global memory size,
- To eventually display mm->reserved_vm in status and put a word about
it in the doc,

Of course I can send a patch but I would rather let you decide the way
you want to go...

Thanks,

--
__
/ ` Eric Valette
/-- __ o _. 6 rue Paul Le Flem
(___, / (_(_(__ 35740 Pace

Tel: +33 (0)2 99 85 26 76 Fax: +33 (0)2 99 85 26 76
E-mail: eric.valette@free.fr