Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-13 Thread Hugh Dickins
On Tue, 10 Jul 2007, Herbert van den Bergh wrote: > Hugh Dickins wrote: > > On Tue, 10 Jul 2007, Dave McCracken wrote: > >> On Tuesday 10 July 2007, Hugh Dickins wrote: > >>> Mapped private readonly yes, but vm_stat_account() says > >>> if (file) { > >>> mm->shared_vm += pages; > >>>

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Herbert van den Bergh
Hugh Dickins wrote: > On Tue, 10 Jul 2007, Dave McCracken wrote: >> On Tuesday 10 July 2007, Hugh Dickins wrote: >>> Mapped private readonly yes, but vm_stat_account() says >>> if (file) { >>> mm->shared_vm += pages; >>> if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC) >>>

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Hugh Dickins
On Tue, 10 Jul 2007, Dave McCracken wrote: > On Tuesday 10 July 2007, Hugh Dickins wrote: > > > > Mapped private readonly yes, but vm_stat_account() says > > if (file) { > > mm->shared_vm += pages; > > if ((flags & (VM_EXEC|VM_WRITE)) == VM_EXEC) > >

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Dave McCracken
On Tuesday 10 July 2007, Hugh Dickins wrote: > On Tue, 10 Jul 2007, Dave McCracken wrote: > > Given that RLIMIT_DATA is pretty much meaningless in current kernels, I > > would put forward the argument that this change is extremely unlikely to > > break anything because no one is currently setting i

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Hugh Dickins
On Tue, 10 Jul 2007, Dave McCracken wrote: > On Tuesday 10 July 2007, Hugh Dickins wrote: > > > > > > > > This brings the Linux behavior in line with what is documented in the > > > > POSIX man page for setrlimit(3p). > > > > Which says malloc() can fail from it, but conspicuously not that mmap() >

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Dave McCracken
On Tuesday 10 July 2007, Hugh Dickins wrote: > On Mon, 9 Jul 2007, Dave McCracken wrote: > > On Monday 09 July 2007, Herbert van den Bergh wrote: > > > With this patch, not only memory in the data segment of a process, but > > > also private data mappings, both file-based and anonymous, are counted

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-10 Thread Hugh Dickins
On Mon, 9 Jul 2007, Dave McCracken wrote: > On Monday 09 July 2007, Herbert van den Bergh wrote: > > With this patch, not only memory in the data segment of a process, but > > also private data mappings, both file-based and anonymous, are counted > > toward the RLIMIT_DATA resource limit.  Executab

Re: [PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-09 Thread Dave McCracken
On Monday 09 July 2007, Herbert van den Bergh wrote: > With this patch, not only memory in the data segment of a process, but > also private data mappings, both file-based and anonymous, are counted > toward the RLIMIT_DATA resource limit.  Executable mappings, such as > text segments of shared obj

[PATCH] include private data mappings in RLIMIT_DATA limit

2007-07-09 Thread Herbert van den Bergh
This patch changes how the kernel limits memory allocations that are controlled by setrlimit() using the RLIMIT_DATA resource. Currently the kernel can limit the size of a process data, bss, and heap, but does not limit the amount of process private memory that can be allocated with the mmap() ca