Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-21 Thread Ulrich Drepper
On 4/21/07, Hugh Dickins <[EMAIL PROTECTED]> wrote: But the Linux MADV_DONTNEED does throw away data from a PROT_WRITE,MAP_PRIVATE mapping (or brk or stack) - those changes are discarded, and a subsequent access will revert to zeroes or the underlying mapped file. Been like that since before

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-21 Thread Hugh Dickins
On Fri, 20 Apr 2007, Ulrich Drepper wrote: > > Just for reference: the MADV_CURRENT behavior is to throw away data in > the range. Not exactly. The Linux MADV_DONTNEED never throws away data from a PROT_WRITE,MAP_SHARED mapping (or shm) - it propagates the dirty bit, the page will eventually

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-21 Thread Hugh Dickins
On Fri, 20 Apr 2007, Ulrich Drepper wrote: Just for reference: the MADV_CURRENT behavior is to throw away data in the range. Not exactly. The Linux MADV_DONTNEED never throws away data from a PROT_WRITE,MAP_SHARED mapping (or shm) - it propagates the dirty bit, the page will eventually get

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-21 Thread Ulrich Drepper
On 4/21/07, Hugh Dickins [EMAIL PROTECTED] wrote: But the Linux MADV_DONTNEED does throw away data from a PROT_WRITE,MAP_PRIVATE mapping (or brk or stack) - those changes are discarded, and a subsequent access will revert to zeroes or the underlying mapped file. Been like that since before

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-20 Thread Ulrich Drepper
On 4/20/07, Andrew Morton <[EMAIL PROTECTED]> wrote: OK, we need to flesh this out a lot please. People often get confused about what our MADV_DONTNEED behaviour is. Well, there's not really much to flesh out. The current MADV_DONTNEED is useful in some situations. The behavior cannot be

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-20 Thread Andrew Morton
On Thu, 19 Apr 2007 17:15:28 -0400 Rik van Riel <[EMAIL PROTECTED]> wrote: > Restore MADV_DONTNEED to its original Linux behaviour. This is still > not the same behaviour as POSIX, but applications may be depending on > the Linux behaviour already. Besides, glibc catches POSIX_MADV_DONTNEED >

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-20 Thread Andrew Morton
On Thu, 19 Apr 2007 17:15:28 -0400 Rik van Riel [EMAIL PROTECTED] wrote: Restore MADV_DONTNEED to its original Linux behaviour. This is still not the same behaviour as POSIX, but applications may be depending on the Linux behaviour already. Besides, glibc catches POSIX_MADV_DONTNEED and

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-20 Thread Ulrich Drepper
On 4/20/07, Andrew Morton [EMAIL PROTECTED] wrote: OK, we need to flesh this out a lot please. People often get confused about what our MADV_DONTNEED behaviour is. Well, there's not really much to flesh out. The current MADV_DONTNEED is useful in some situations. The behavior cannot be

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-19 Thread Rik van Riel
Restore MADV_DONTNEED to its original Linux behaviour. This is still not the same behaviour as POSIX, but applications may be depending on the Linux behaviour already. Besides, glibc catches POSIX_MADV_DONTNEED and makes sure nothing is done... Signed-off-by: Rik van Riel <[EMAIL PROTECTED]>

Re: [PATCH] lazy freeing of memory through MADV_FREE 2/2

2007-04-19 Thread Rik van Riel
Restore MADV_DONTNEED to its original Linux behaviour. This is still not the same behaviour as POSIX, but applications may be depending on the Linux behaviour already. Besides, glibc catches POSIX_MADV_DONTNEED and makes sure nothing is done... Signed-off-by: Rik van Riel [EMAIL PROTECTED] ---