Subject: Redefining MAXDSIZ / RLIMIT_DATA
To: None <tech-kern@NetBSD.org>
From: Matt Thomas <email@example.com>
Date: 12/15/2003 11:07:23
The notion of a process being split into a text section, a data section
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: firstname.lastname@example.org
3am Software Foundry www: http://3am-software.com/bio/matt/
Cupertino, CA disclaimer: I avow all knowledge of this