tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: RLIMIT_AS and fixed process size calculations patch
In article <8141.1238205299%splode.eterna.com.au@localhost>,
matthew green <mrg%eterna.com.au@localhost> wrote:
>
>
>hi folks.
>
>the patch below implements 3 things:
>
> 1 - adds a new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits
> the total address space available to processes. this limit
> exists in most other modern unix variants, and like most of
> them, our defaults are unlimited.
>
> 2 - adds the VMCMD_STACK flag to all the stack-creation vmcmd
> callers. it is currently unused, but was added a few years ago.
>
> 3 - adds a pair of new process size values to kinfo_proc2{}.
> one is the total size of the process memory map, and the other
> is the total size adjusted for unused stack space (since most
> processes have a lot of this...)
>
>
>i plan to commit this in a couple of days. please comment.
>
>
>.mrg.
>
>
>Index: sys/sys/sysctl.h
>===================================================================
>RCS file: /cvsroot/src/sys/sys/sysctl.h,v
>retrieving revision 1.183
>diff -p -r1.183 sysctl.h
>*** sys/sys/sysctl.h 20 Jan 2009 18:20:48 -0000 1.183
>--- sys/sys/sysctl.h 27 Mar 2009 22:49:04 -0000
>*************** struct kinfo_proc2 {
>*** 587,592 ****
>--- 587,594 ----
> uint32_t p_svuid; /* UID_T: saved user id */
> uint32_t p_svgid; /* GID_T: saved group id */
> char p_ename[KI_MAXEMULLEN]; /* emulation name */
>+ int64_t p_vm_vsize; /* SEGSZ_T: total map size (pages) */
>+ int64_t p_vm_msize; /* SEGSZ_T: stack-adjusted map size
>(pages) */
> };
Looks great Matt! One question, why aren't those two uint64_t?
christos
Home |
Main Index |
Thread Index |
Old Index