Re: proc_pid_statm

From: William Lee Irwin III (wli@holomorphy.com)
Date: Fri Dec 07 2001 - 00:00:06 EST


On Fri, Dec 07, 2001 at 09:38:35AM +0530, BALBIR SINGH wrote:
> I looked at ELF_ET_DYN_BASE and it is defined differently on
> different architectures. For example on an i386, it is defined
> to be 2GB which is 0x80000000.

The corrected patch follows:

--- linux-2.4.17-pre4-virgin/fs/proc/array.c Thu Oct 11 09:00:01 2001
+++ linux-2.4.17-pre4/fs/proc/array.c Thu Dec 6 20:58:36 2001
@@ -491,14 +491,13 @@
                         share += shared;
                         dt += dirty;
                         size += total;
- if (vma->vm_flags & VM_EXECUTABLE)
- trs += pages; /* text */
- else if (vma->vm_flags & VM_GROWSDOWN)
- drs += pages; /* stack */
- else if (vma->vm_end > 0x60000000)
- lrs += pages; /* library */
- else
- drs += pages;
+ if (vma->vm_flags & VM_EXECUTABLE) {
+ if(vma->vm_end > TASK_UNMAPPED_BASE)
+ lrs += pages; /* library */
+ else
+ trs += pages; /* text */
+ } else
+ drs += pages; /* stack and data */
                         vma = vma->vm_next;
                 }
                 up_read(&mm->mmap_sem);
-
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/



This archive was generated by hypermail 2b29 : Fri Dec 07 2001 - 21:00:37 EST