Subject: Redefining MAXDSIZ / RLIMIT_DATA
To: None <>
From: Matt Thomas <>
List: tech-kern
Date: 12/15/2003 11:07:23
The notion of a process being split into a text section, a data section 
(+ bss),
and a stack section is mostly outdated.  Except for the use of brk/sbrk,
nothing really cares these distinctions.

I propose redefining MAXDSIZ and RLIMIT_DATA from being the size of a
program data section to the number of bytes in pages backed by anonymous
storage (aka swap).  This redefinition will allow limitations on the 
mmap'ed anonymous pages (which currently has no limitations).

A process will still have text, data, and stack sections for 
but, other than brk/sbrk, nothing will care.

As for accounting, there are 4 cases when a page could be considered 

1) when copy-on-write (or demand-zeroed) but not yet faulted.
2) when copy-on-write (or demand-zeroed) and read-faulted.
3) when first write-faulted.
4) when actually needing to allocate a swap location

The first case is useful on when you want to prevent over-commitments on
the amount of swap.  The others are just various methods of 

Matt Thomas                     email:
3am Software Foundry              www:
Cupertino, CA              disclaimer: I avow all knowledge of this