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

2011-10-17 Thread Richard Guenther
On Sun, Oct 16, 2011 at 8:33 PM, Andi Kleen a...@firstfloor.org 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 a...@firstfloor.org wrote: Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com

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

2011-10-16 Thread Andi Kleen
Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com 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

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 a...@firstfloor.org wrote: Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com 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

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 a...@firstfloor.org wrote: Andi Kleen a...@firstfloor.org writes: From: Andi Kleen a...@linux.intel.com Use the Linux MADV_DONTNEED call to unmap free pages in the garbage

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 a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com 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

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 a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com 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-10 Thread Richard Guenther
On Mon, Oct 10, 2011 at 12:45 PM, Jakub Jelinek ja...@redhat.com 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 a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com Use the Linux MADV_DONTNEED call to unmap

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 will

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 a...@firstfloor.org 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

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

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

2011-10-09 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com 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