Enable init_ggc_heuristics for ENABLE_GC_CHECKING.
diff mbox series

Message ID b1081f6a-f529-86a2-fce1-e66753590593@suse.cz
State New
Headers show
Series
  • Enable init_ggc_heuristics for ENABLE_GC_CHECKING.
Related show

Commit Message

Martin Liška Nov. 19, 2019, 8:12 a.m. UTC
One potential improvement is to enable the heuristics
for ENABLE_GC_CHECKING. The macro is about sanity checking
and poisoning of GGC memory. Which seems to me completely
independent to setting of the default parameters.

Ready to be installed?
Thanks,
Martin

Comments

Richard Biener Nov. 19, 2019, 9:12 a.m. UTC | #1
On Tue, Nov 19, 2019 at 9:12 AM Martin Liška <mliska@suse.cz> wrote:
>
> One potential improvement is to enable the heuristics
> for ENABLE_GC_CHECKING. The macro is about sanity checking
> and poisoning of GGC memory. Which seems to me completely
> independent to setting of the default parameters.

Well, doing more collects also is "checking" and the GC checking part
this way becomes deterministic (not dependent on host setup) so no,
this is by no means an obvious change.  If we think we collect too
often we can adjust the GC param static defaults to todays reality instead
(mostly --param ggc-min-heapsize which has been 4MB for ages).

Btw, I see the params.opt default is now 4096 unconditionally so
does ENABLE_GC_ALWAYS_COLLECT no longer "work"?
It used to adjust the params.def default values.

Richard.

> Ready to be installed?
> Thanks,
> Martin
Martin Liška Nov. 19, 2019, 11:36 a.m. UTC | #2
On 11/19/19 10:12 AM, Richard Biener wrote:
> On Tue, Nov 19, 2019 at 9:12 AM Martin Liška <mliska@suse.cz> wrote:
>>
>> One potential improvement is to enable the heuristics
>> for ENABLE_GC_CHECKING. The macro is about sanity checking
>> and poisoning of GGC memory. Which seems to me completely
>> independent to setting of the default parameters.
> 
> Well, doing more collects also is "checking" and the GC checking part
> this way becomes deterministic (not dependent on host setup) so no,
> this is by no means an obvious change.  If we think we collect too
> often we can adjust the GC param static defaults to todays reality instead
> (mostly --param ggc-min-heapsize which has been 4MB for ages).

Sure, that's probably more reasonable change we can do. Do you have a suggestion
when can default be now?

> 
> Btw, I see the params.opt default is now 4096 unconditionally so
> does ENABLE_GC_ALWAYS_COLLECT no longer "work"?
> It used to adjust the params.def default values.

It will work with ENABLE_GC_ALWAYS_COLLECT once the patch
in previous email will be applied.

Martin

> 
> Richard.
> 
>> Ready to be installed?
>> Thanks,
>> Martin
Richard Biener Nov. 19, 2019, 12:39 p.m. UTC | #3
On Tue, Nov 19, 2019 at 12:36 PM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/19/19 10:12 AM, Richard Biener wrote:
> > On Tue, Nov 19, 2019 at 9:12 AM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> One potential improvement is to enable the heuristics
> >> for ENABLE_GC_CHECKING. The macro is about sanity checking
> >> and poisoning of GGC memory. Which seems to me completely
> >> independent to setting of the default parameters.
> >
> > Well, doing more collects also is "checking" and the GC checking part
> > this way becomes deterministic (not dependent on host setup) so no,
> > this is by no means an obvious change.  If we think we collect too
> > often we can adjust the GC param static defaults to todays reality instead
> > (mostly --param ggc-min-heapsize which has been 4MB for ages).
>
> Sure, that's probably more reasonable change we can do. Do you have a suggestion
> when can default be now?

I'm not sure.  For GC checking (poisoning, etc.) more collecting is
better because
then stuff is poisoned earlier.  The question is really the intent here.

> >
> > Btw, I see the params.opt default is now 4096 unconditionally so
> > does ENABLE_GC_ALWAYS_COLLECT no longer "work"?
> > It used to adjust the params.def default values.
>
> It will work with ENABLE_GC_ALWAYS_COLLECT once the patch
> in previous email will be applied.
>
> Martin
>
> >
> > Richard.
> >
> >> Ready to be installed?
> >> Thanks,
> >> Martin
>

Patch
diff mbox series

From e0eab3674caedfcd5b332a335f513c501ab8dfb4 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 19 Nov 2019 09:09:05 +0100
Subject: [PATCH] Enable init_ggc_heuristics for ENABLE_GC_CHECKING.

gcc/ChangeLog:

2019-11-19  Martin Liska  <mliska@suse.cz>

	* opts.c: Enable init_ggc_heuristics for situation
	when ENABLE_GC_CHECKING is enabled.
---
 gcc/opts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/opts.c b/gcc/opts.c
index 7e363e5c1d6..3c197bc2f76 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -275,7 +275,7 @@  init_opts_obstack (void)
   gcc_obstack_init (&opts_obstack);
 }
 
-#if !defined ENABLE_GC_CHECKING && !defined ENABLE_GC_ALWAYS_COLLECT
+#if !defined ENABLE_GC_ALWAYS_COLLECT
 
 /* Modify the bound based on rlimits.  */
 
@@ -373,7 +373,7 @@  ggc_min_heapsize_heuristic (void)
 static void
 init_ggc_heuristics (void)
 {
-#if !defined ENABLE_GC_CHECKING && !defined ENABLE_GC_ALWAYS_COLLECT
+#if !defined ENABLE_GC_ALWAYS_COLLECT
   param_ggc_min_expand = ggc_min_expand_heuristic ();
   param_ggc_min_heapsize = ggc_min_heapsize_heuristic ();
 #endif
-- 
2.24.0