This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Sun, Oct 16, 2011 at 7:30 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Andi Kleen <andi@firstfloor.org> writes:
>
>> From: Andi Kleen <ak@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 process.
>
> Could I have a decision on this patch please? The problem in PR50636
> is still there and this is the minimum fix to fix it on Linux
> as far as I know.
>
> If this patch is not the right way to go I would
> appreciate some guidance on an alternative (but low cost)
> implementation. Note I don't have capacity for any overly
> complicated solutions.

The patch looks generally ok, but you are never giving back pages to the
system, and as we have other memory allocations that do not use the
ggc pools you drain virtual memory on 32bit hosts.  Is any other patch
in this series compensating for it?  If not I'd say we should munmap the
pages when a full mapped range (2MB) is free.  Can you rename
'unmapped' to 'discarded' please?  That would be less confusing.

Thanks,
Richard.

> Thanks,
>
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]