This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 4/5] Add a freeing threshold for the garbage collector.
On Mon, Oct 10, 2011 at 12:20:53PM +0200, Richard Guenther wrote:
> On Sun, Oct 9, 2011 at 9:55 PM, Andi Kleen <andi@firstfloor.org> wrote:
> > From: Andi Kleen <ak@linux.intel.com>
> >
> > Add a threshold to avoid freeing pages back too early to the OS.
> > This avoid virtual memory map fragmentation.
> >
> > Based on a idea from Honza
>
> Less than 20% looks high. Shouldn't ggc-free-min be enough to
> avoid fragmentation?
It depends on the working set. If there's more to garbage collect
than max(ggc-free-min, threshold*total) a host without MADV_DONTNEED
will get holes. And ggc-free-min isn't very much on a large
build.
So it seems safer to me to have a threshold which adjusts for large
working sets. What value do you prefer instead of 20%? (or just 0)
>
> This will hide gc bugs with always-collect (ggc-checking), so
> the parameter(s) need to be adjusted for that case to always
> give pages back. The current values should probably be printed
> where the two existing ones are printed as well (with -v).
Will fix.
-Andi