Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-16 Thread Richard Guenther
On Sun, Oct 16, 2011 at 8:33 PM, Andi Kleen wrote: > On Sun, Oct 16, 2011 at 12:38:16PM +0200, Richard Guenther wrote: >> On Sun, Oct 16, 2011 at 7:30 AM, Andi Kleen wrote: >> > Andi Kleen writes: >> > >> >> From: Andi Kleen >> >> >> >> Use the Linux MADV_DONTNEED call to unmap free pages in th

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-16 Thread Andi Kleen
On Sun, Oct 16, 2011 at 12:38:16PM +0200, Richard Guenther wrote: > On Sun, Oct 16, 2011 at 7:30 AM, Andi Kleen wrote: > > Andi Kleen writes: > > > >> From: Andi Kleen > >> > >> Use the Linux MADV_DONTNEED call to unmap free pages in the garbage > >> collector.Then keep the unmapped pages in the

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-16 Thread Richard Guenther
On Sun, Oct 16, 2011 at 7:30 AM, Andi Kleen wrote: > Andi Kleen writes: > >> From: Andi Kleen >> >> Use the Linux MADV_DONTNEED call to unmap free pages in the garbage >> collector.Then keep the unmapped pages in the free list. This avoid >> excessive memory fragmentation on large LTO bulds, whi

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-16 Thread Andi Kleen
Andi Kleen writes: > From: Andi Kleen > > Use the Linux MADV_DONTNEED call to unmap free pages in the garbage > collector.Then keep the unmapped pages in the free list. This avoid > excessive memory fragmentation on large LTO bulds, which can lead > to gcc bumping into the Linux vm_max_map limit

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Andi Kleen
> So can we move the param patch back as a possible followup? I can drop it, however it will still mean fragmentation on any non Linux (or rather non MADV_DONTNEED) hosts. -Andi

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Richard Guenther
On Mon, Oct 10, 2011 at 4:04 PM, Andi Kleen wrote: >> Shouldn't we prefer still "mapped" pages when allocating?  Thus, keep >> the freepages list "sorted"? > > Possibly. I can look at it in a followup if you want. > I would prefer to not complicate this patch too much. > >> >> With the new params

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Andi Kleen
> Shouldn't we prefer still "mapped" pages when allocating? Thus, keep > the freepages list "sorted"? Possibly. I can look at it in a followup if you want. I would prefer to not complicate this patch too much. > > With the new params to call release_pages less, how does this > interact with us

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Jakub Jelinek
On Mon, Oct 10, 2011 at 01:11:13PM +0200, Richard Guenther wrote: > > I don't see why.  MADV_DONTNEED isn't perfect, what it does (on Linux) > > is that it zaps the whole page range, which essentially brings it into > > the exact same state as immediately after mmap.  Any touch of the > > pages wil

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Richard Guenther
On Mon, Oct 10, 2011 at 12:45 PM, Jakub Jelinek wrote: > On Mon, Oct 10, 2011 at 12:25:15PM +0200, Richard Guenther wrote: >> On Sun, Oct 9, 2011 at 9:55 PM, Andi Kleen wrote: >> > From: Andi Kleen >> > >> > Use the Linux MADV_DONTNEED call to unmap free pages in the garbage >> > collector.Then

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Jakub Jelinek
On Mon, Oct 10, 2011 at 12:25:15PM +0200, Richard Guenther wrote: > On Sun, Oct 9, 2011 at 9:55 PM, Andi Kleen wrote: > > From: Andi Kleen > > > > Use the Linux MADV_DONTNEED call to unmap free pages in the garbage > > collector.Then keep the unmapped pages in the free list. This avoid > > excess

Re: [PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-10 Thread Richard Guenther
On Sun, Oct 9, 2011 at 9:55 PM, Andi Kleen wrote: > From: Andi Kleen > > Use the Linux MADV_DONTNEED call to unmap free pages in the garbage > collector.Then keep the unmapped pages in the free list. This avoid > excessive memory fragmentation on large LTO bulds, which can lead > to gcc bumping i

[PATCH 1/5] Use MADV_DONTNEED for freeing in garbage collector

2011-10-09 Thread Andi Kleen
From: Andi Kleen Use the Linux MADV_DONTNEED call to unmap free pages in the garbage collector.Then keep the unmapped pages in the free list. This avoid excessive memory fragmentation on large LTO bulds, which can lead to gcc bumping into the Linux vm_max_map limit per process. Based on a idea f