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 >> 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 > > -- > a...@linux.intel.com -- Speaking for myself only >