From: "Richard Guenther" <richard.guenther@gmail.com>
To: "Zdenek Dvorak" <rakdver@kam.mff.cuni.cz>
Cc: "Daniel Berlin" <dberlin@dberlin.org>,
"Alexandre Oliva" <aoliva@redhat.com>,
"Mark Mitchell" <mark@codesourcery.com>,
"Ian Lance Taylor" <iant@google.com>,
"Mike Stump" <mrs@apple.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [patch] Move loop structures to gc memory
Date: Thu, 17 May 2007 17:58:00 -0000 [thread overview]
Message-ID: <84fc9c000705171058w1b64756di8c70e1736f104cb1@mail.gmail.com> (raw)
In-Reply-To: <20070517142427.GA4070@kam.mff.cuni.cz>
On 5/17/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hello,
>
> > Except that you lose all the benefits of it *not* being in GC.
> >
> > As a concrete example:
> >
> > Our basic blocks were pool allocated using alloc_pool's.
> > Because they started pointing to GC'd structures directly (in order to
> > simplify things), we switched them to be gc alloced.
> >
> > We lost about 1-2% compile time from doing this (see the archives),
> > because alloc pools are contiguous in memory, and our gc was just
> > handing out random free memory that happened to be around the same
> > size.
> >
> > Things that have a very well defined lifetime (which are basic blocks
> > do, for example), should not have to be in GC memory simply because
> > they point to GC objects.
> >
> > You can argue that "well, it doesn't really hurt most of the time",
> > "we could improve the GC to get better locality" etc, but it doesn't
> > change that basic premise. No one in this thread has yet given a good
> > reason we should have to GC things that we don't want to GC, just to
> > get things they point to GC'd without really ugly hacks/workarounds.
> >
> > The only reason i've seen is "well, it's hard".
> >
> > Speed wise, profiles of the GC have never shown the actual root list
> > walking to be slow, only the actual mark lookups and sets. Adding
> > dynamic roots would make the root list walking slightly slower, but if
> > we have *less* things in GC overall, we will do less mark setting,
> > which is where most of GC time goes.
> > So it should be a win overall.
>
> something like the patch below? It allows you:
>
> -- to specify a custom marking routine for a particular type, that is
> called instead of the one provided by garbage collector. This
> enables the objects of this type not to be allocated by gc, and
> still survive ggc_collect even if gc collected things point to
> them
> -- adds dynamic roots to ggc-common
> -- implements a particular instance of considering all objects allocated
> in an alloc pool to be roots
> -- and applies it to make basic blocks pool allocated
>
> I guess this covers most of the profitable cases (basic blocks, edges,
> loop structures), but it is easy to extend for other modes of
> allocation. For simplicity, the patch allocates all basic blocks from
> a single pool; it might be better to use per-function pools instead
> (that would however need some more changes, in particular the way
> omp code moves basic blocks between functions would break).
>
> Of course, the patch is not quite finished (in particular, I am fairly
> sure it breaks pch), but I would like to know whether we are both
> thinking about the same thing, or if you imagine something different.
Heh, I like this. PCH should be the last thing to care about.
Richard.
next prev parent reply other threads:[~2007-05-17 17:58 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-13 18:08 Zdenek Dvorak
2007-05-13 18:20 ` Richard Guenther
2007-05-13 18:33 ` Zdenek Dvorak
2007-05-13 18:49 ` Daniel Berlin
2007-05-14 18:13 ` Ian Lance Taylor
2007-05-14 20:58 ` Zdenek Dvorak
2007-05-14 21:19 ` Mike Stump
2007-05-14 21:28 ` Ian Lance Taylor
2007-05-14 21:41 ` Zdenek Dvorak
2007-05-14 22:35 ` Ian Lance Taylor
2007-05-14 22:32 ` Daniel Jacobowitz
2007-05-14 22:38 ` Ian Lance Taylor
2007-05-14 22:55 ` Zdenek Dvorak
2007-05-14 23:02 ` Daniel Jacobowitz
2007-05-14 23:25 ` Ian Lance Taylor
2007-05-15 2:14 ` Daniel Jacobowitz
2007-05-16 1:23 ` Mark Mitchell
2007-05-16 4:42 ` Mike Stump
2007-05-16 6:55 ` Alexandre Oliva
2007-05-16 15:54 ` Daniel Berlin
2007-05-17 0:18 ` Alexandre Oliva
2007-05-17 0:33 ` Mark Mitchell
2007-05-17 4:11 ` Alexandre Oliva
2007-05-17 4:18 ` Mark Mitchell
2007-05-17 5:21 ` Alexandre Oliva
2007-05-17 0:48 ` Ian Lance Taylor
2007-05-17 3:30 ` Alexandre Oliva
2007-05-17 4:30 ` Daniel Berlin
2007-05-17 5:38 ` Alexandre Oliva
2007-05-17 14:38 ` Ian Lance Taylor
2007-05-17 19:50 ` Alexandre Oliva
2007-05-17 16:03 ` Mike Stump
2007-05-17 17:38 ` Daniel Berlin
2007-05-17 19:57 ` Alexandre Oliva
2007-05-17 20:06 ` Zdenek Dvorak
2007-05-18 8:33 ` Alexandre Oliva
2007-05-18 15:09 ` Daniel Berlin
2007-05-18 16:53 ` Alexandre Oliva
2007-05-18 17:37 ` Daniel Berlin
2007-05-18 17:46 ` Michael Matz
2007-05-18 18:50 ` Mike Stump
2007-05-17 20:11 ` Daniel Jacobowitz
2007-05-17 14:24 ` Zdenek Dvorak
2007-05-17 17:46 ` Daniel Berlin
2007-05-17 17:58 ` Richard Guenther [this message]
2007-05-14 23:57 ` Mike Stump
2007-05-15 4:07 ` Steven Bosscher
2007-05-15 6:15 ` Mike Stump
2007-05-15 7:02 ` Paolo Bonzini
2007-05-15 8:35 ` Mike Stump
2007-05-15 15:00 ` Ian Lance Taylor
2007-05-15 15:20 ` Michael Matz
2007-05-15 21:49 ` Ian Lance Taylor
2007-05-16 4:37 ` Mike Stump
2007-05-16 4:42 ` Ian Lance Taylor
2007-05-16 4:56 ` Mike Stump
2007-05-16 4:30 ` Mike Stump
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84fc9c000705171058w1b64756di8c70e1736f104cb1@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=aoliva@redhat.com \
--cc=dberlin@dberlin.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=iant@google.com \
--cc=mark@codesourcery.com \
--cc=mrs@apple.com \
--cc=rakdver@kam.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).