unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Linas Vepstas <linasvepstas@gmail.com>
To: Marko Rauhamaa <marko@pacujo.net>
Cc: "Ludovic Courtès" <ludo@gnu.org>, "Guile User" <guile-user@gnu.org>
Subject: Re: Guile bugs
Date: Sat, 9 Sep 2017 18:02:26 -0500	[thread overview]
Message-ID: <CAHrUA37_jtQ9EHPd3uBgh-hT0idqFq-sRvODZ2YptZqxNDBCQQ@mail.gmail.com> (raw)
In-Reply-To: <87wp57mrmb.fsf@elektro.pacujo.net>

Hi Marko,

On Sat, Sep 9, 2017 at 5:31 PM, Marko Rauhamaa <marko@pacujo.net> wrote:

> Linas Vepstas <linasvepstas@gmail.com>:
> > So if you used GC_malloc_atomic() in your code, then gc will NOT scan
> > that region for pointers. guile-2.2 does this correctly for strings (I
> > checked) because strings will never contain pointers. I have not
> > checked other uses.
>
> The question about mmap(2) is addressed more directly by the README
> under <URL: https://github.com/ivmai/bdwgc>:
>
>    Any objects not intended to be collected must be pointed to either
>    from other such accessible objects, or from the registers, stack,
>    data, or statically allocated bss segments. [...]
>
>    WARNING: pointers inside memory allocated by the standard malloc are
>    not seen by the garbage collector. Thus objects pointed to only from
>    such a region may be prematurely deallocated. It is thus suggested
>    that the standard malloc be used only for memory regions, such as I/O
>    buffers, that are guaranteed not to contain pointers to garbage
>    collectible memory.
>
>    [...]
>
>    WARNING: the collector does not guarantee to scan thread-local
>    storage (e.g. of the kind accessed with pthread_getspecific). The
>    collector does scan thread stacks
>
> Now, the question is, can you make your multigigabyte allocation go into
> these excluded memory segments? Are you still hit by the pathological GC
> behavior you reported?
>

What, my app, specifically? Uh yeah. All of my c++ objects go through
plain-old malloc and should be 100% invisible to guile and to bdwgc and
that's perfect.

I do have a layer where guile interacts with the C++ code, and all the
various bits and pieces are correctly declared everywhere.  That code is
about 8-10 years old, its been maintained all that time, its been in use
all that time, and works without issues.

"works without issues" means this: A typical run for me uses some 50-100
threads, maybe 1/2 of these in guile. Due to lock contention, in practice
only 3 to 10 of these threads ever get scheduled, and this is fine, and not
unexpected.  My algos are the opposite of "embrassingly parallel", so low
parallelism is expected. Each processing run goes for a few days to weeks
or over a month, uses 2 to 50GB RAM, does not leak memory, does not crash,
its stable, predictable, does what its supposed to do, terminates cleanly.

It does sometimes run much slower than expected (about 1/2x or 1/4x) and I
don't know why.  I don't usually monitor GC, but when I do, it seems that a
lot of cpu time gets wasted there. Sometimes other people also notice this,
bitch at me, and propose silly solutions. I've been ignoring that as
lower-priority.

Only now it's risen up and is biting hard, and I don't understand how or
why gc gets triggered in guile.  For my app, it seems that it is running
far, far too often, and is severely slowing/preventing forward progress.

--linas

>
>
> Marko
>



-- 
*"The problem is not that artificial intelligence will get too smart and
take over the world," computer scientist Pedro Domingos writes, "the
problem is that it's too stupid and already has." *


  reply	other threads:[~2017-09-09 23:02 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-12 23:56 How to make GNU Guile more successful Amirouche
2017-02-13  0:21 ` Amirouche
2017-02-13 11:06 ` Arne Babenhauserheide
2017-02-13 12:14   ` Arne Babenhauserheide
2017-02-13 20:20   ` Amirouche
2017-02-13 23:08     ` Arne Babenhauserheide
2017-02-13 20:28   ` Panicz Maciej Godek
2017-02-13 20:42     ` Amirouche
2017-02-13 22:34     ` Marko Rauhamaa
2017-02-13 23:56       ` Arne Babenhauserheide
2017-02-14  0:18         ` David Kastrup
2017-02-14 22:21           ` Arne Babenhauserheide
2017-02-15 17:03           ` Christopher Allan Webber
2017-02-16 19:18             ` sirgazil
2017-02-16 20:26               ` Amirouche
2017-02-14  5:59         ` Marko Rauhamaa
2017-02-14 19:36           ` Linas Vepstas
2017-02-14 20:54             ` Marko Rauhamaa
2017-02-14 22:20           ` Arne Babenhauserheide
2017-02-13 22:54     ` Arne Babenhauserheide
2017-02-14  9:54       ` Panicz Maciej Godek
2017-02-14 21:35         ` Arne Babenhauserheide
2017-03-01 19:21           ` Amirouche
2017-03-10 20:23             ` Amirouche
2017-07-14 21:54     ` Linas Vepstas
2017-07-14 21:59       ` Marko Rauhamaa
2017-07-15 10:10       ` Jan Wedekind
2017-07-15 12:55         ` Nala Ginrut
2017-07-15 12:58           ` Nala Ginrut
2017-07-15 22:17           ` Jan Wedekind
2017-07-16  9:54             ` Nala Ginrut
2017-07-17 18:52         ` Arun Isaac
2017-07-18 11:22         ` Ernest Adrogué
2017-07-16  8:30       ` Freja Nordsiek
2017-07-16  9:18         ` Marko Rauhamaa
2017-07-16 10:11           ` Freja Nordsiek
2017-07-16 10:31             ` Marko Rauhamaa
2017-07-16 10:39               ` Freja Nordsiek
2017-07-16 10:45                 ` Freja Nordsiek
2017-07-20 15:28       ` Guile bugs Ludovic Courtès
2017-07-20 16:22         ` Marko Rauhamaa
2017-07-20 18:26           ` Taylan Ulrich Bayırlı/Kammer
2017-07-20 18:35             ` Marko Rauhamaa
2017-07-20 20:41               ` Ludovic Courtès
2017-07-20 22:23                 ` Marko Rauhamaa
2017-07-21  4:05                   ` Mark H Weaver
2017-07-21  6:15                     ` Marko Rauhamaa
2017-07-21  8:16                       ` Chris Vine
2017-07-21  8:27                         ` Marko Rauhamaa
2017-07-21  9:17                       ` Mark H Weaver
2017-07-21 10:08                         ` Marko Rauhamaa
2017-07-21 10:22                           ` David Kastrup
2017-09-09 21:14                       ` Linas Vepstas
2017-09-09 22:31                         ` Marko Rauhamaa
2017-09-09 23:02                           ` Linas Vepstas [this message]
2017-07-21 16:33               ` Taylan Ulrich Bayırlı/Kammer
2017-07-21 17:12                 ` Marko Rauhamaa
2017-07-21 14:19           ` Matt Wette
2017-09-09 20:30         ` Linas Vepstas
2017-09-10 13:11           ` Ludovic Courtès
2017-09-10 19:56             ` Linas Vepstas
2017-09-11  7:26               ` Ludovic Courtès
2017-09-11  8:10                 ` Marko Rauhamaa
2017-09-11 11:34                   ` Ludovic Courtès
2017-09-14 17:54                 ` Linas Vepstas
2017-09-15  7:56                   ` Ludovic Courtès
2017-09-19 11:04                     ` Linas Vepstas
2017-09-19 20:18                       ` Chris Vine
2017-09-19 20:21                         ` Chris Vine
2017-09-19 23:39                           ` Nala Ginrut

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

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHrUA37_jtQ9EHPd3uBgh-hT0idqFq-sRvODZ2YptZqxNDBCQQ@mail.gmail.com \
    --to=linasvepstas@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    --cc=marko@pacujo.net \
    /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).