public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Inconsistancies in /proc (status vs statm) leading to wrong documentation (proc.txt)
@ 2004-10-09  9:54 Eric Valette
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Valette @ 2004-10-09  9:54 UTC (permalink / raw)
  To: Linus Torvalds, wli; +Cc: Linux Kernel Mailing List

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




^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Inconsistancies in /proc (status vs statm) leading to wrong documentation (proc.txt)
@ 2004-10-09 13:49 Albert Cahalan
  2004-10-09 14:08 ` Eric Valette
  0 siblings, 1 reply; 7+ messages in thread
From: Albert Cahalan @ 2004-10-09 13:49 UTC (permalink / raw)
  To: linux-kernel mailing list; +Cc: eric.valette

Eric Valette writes:

> 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)

The documentation is incorrect. It was written to match a buggy
implementation in early 2.6.x kernels.

VmSize is the address space occupied, excluding memory-mapped IO.
The statm value is the address space occupied.

> May I suggest :
>  - To use consistent memory size units between status and statm,

No way. This would instantly break the "top" program.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-09 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-09  9:54 Inconsistancies in /proc (status vs statm) leading to wrong documentation (proc.txt) Eric Valette
  -- strict thread matches above, loose matches on Subject: below --
2004-10-09 13:49 Albert Cahalan
2004-10-09 14:08 ` Eric Valette
2004-10-09 16:31   ` Albert Cahalan
2004-10-09 16:46     ` Eric Valette
2004-10-09 16:59       ` Albert Cahalan
2004-10-09 17:46         ` Eric Valette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox