unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,  Emacs Devel <emacs-devel@gnu.org>
Subject: Re: MPS: Loaded pdump
Date: Thu, 09 May 2024 15:37:00 +0200	[thread overview]
Message-ID: <m2edabayyr.fsf@pro2.fritz.box> (raw)
In-Reply-To: <87le4jp3t0.fsf@gmail.com> (Helmut Eller's message of "Thu, 09 May 2024 14:28:43 +0200")

Helmut Eller <eller.helmut@gmail.com> writes:

> On Thu, May 09 2024, Gerd Möllmann wrote:
>
>> I feel more and more that the handling of the loaded pdump with MPS as
>> it is now is not sustainable, and would like ask you for your ideas.
>>
>> What we do now is make the hot part of the dump an ambig root. I don't
>> remember the exact numbers, but I think that's about 18 Mb of root. This
>> has at least these problems, from my POV:
>>
>> - It is very large, and every time MPS scans roots, and that is all the
>>   time, the world is stopped until it has finished. That's not good for
>>   pause times.
>
> Maybe it would be better with the MPS_RM_PROT option.  Do you know which
> of the telemetry events could be used to measure this?

No idea. I've only looked at telemetry to see if it had something
helping me debug things. I didn't see anything obvious doing that at the
time. Maybe you could just add the PROT and see what the difference is?

> I recorded telemetry for the nbody benchmark.  It seems that there are
> 16 GC flips.  From one TraceFlipBegin event to the next TraceFlipEnd
> takes about 32 million cycles (I think the timestamps are cycles, as
> returned by rtdsc).  If we assume the clock frequency is 2.5 GHz that
> would be about 13 milliseconds per GC flip.  But I don't know what the
> events actually mean and whether this includes scanning the pdump.

In "Old Design" it says

  7.4.3. The flip phase

  .phase.flip: The roots (see design.mps.root) are scanned. This has to be
  an atomic action as far as the mutator is concerned, so all threads are
  suspended for the duration.

which probably means that between flips all roots are scanned. Unless
there is something "new" meanwhile.

Does telemetry show something concerning root?

I initially thought we could get away with the root not the least
because Emacs as an interactive program probably doesn't require a big
throughput. When I run it with MPS, what I observe doesn't prove this
immediately wrong at least.

But the horrible workarounds like last for the CUs, and the half a dozen
before that, which are only 90%, and the remaining 90% are still out
there. That's so horrible. And on top of all that, I don't have debug
info for elns ;-).

And right now I rememberd pure space. What is with pure space... Not now.

>> This has of course also consequences:
>>
>> - copying 18 Mb of hot objects + 12 Mb or so of leaf objects to MPS
>>   could be slow. No idea if it is. That could impact startup time (not
>>   important to me at all, but people have different preferences).
>
> It would certainly be interesting to know how long it takes.

I could add a DEFUN that allocates a mixture of objects. I think all
vectors of different sizes probably suffices. I don't think the type of
object makes a difference.

>> - copying the graph requires that the copying functions know the layout
>>   of Lisp objects so that the functions can exchange references in the
>>   old graph to the corresponding ones in the new graph. I'm getting
>>   exhausted already from thinking of writing such functions, and we
>>   don't have C++ templates to help.
>
> Do we need to know the layout or can we get away with just knowing the
> size and the relocation information that the pdump already has?

Does it have the size? I wondered that a while back, considering the
marking in the old GC where I got the impression that there is maybe
more info in the pdump.

>> - AFAIK, but see admin/igc.org, there is no good way of allocating
>>   objects in an old generation, so they will maybe take some time to
>>   wander to an older generation.
>
> There is this ramp allocation pattern but it's not exactly what we
> need.

Yeah ;-)

>> Enough rambling.
>>
>> Ideas, opinions, ...?
>
> Does Open Dylan use MPS in some way to dump/load a large amount of
> state?

No idea. Given that Dylan in a way came out of CL, I always assumed it
had the same image-based development model. But I've never used Dylan
myself. I'll try to find out.



  reply	other threads:[~2024-05-09 13:37 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 10:52 MPS: Loaded pdump Gerd Möllmann
2024-05-09 11:00 ` Eli Zaretskii
2024-05-09 11:20   ` Gerd Möllmann
2024-05-09 12:28 ` Helmut Eller
2024-05-09 13:37   ` Gerd Möllmann [this message]
2024-05-09 16:10     ` Helmut Eller
2024-05-09 16:43       ` Gerd Möllmann
2024-05-09 17:57         ` Helmut Eller
2024-05-09 18:10           ` Gerd Möllmann
2024-05-09 13:38 ` Helmut Eller
2024-05-09 14:18   ` Gerd Möllmann
2024-05-09 15:01     ` Helmut Eller
2024-05-09 15:07       ` Gerd Möllmann
2024-05-10  7:59         ` Gerd Möllmann
2024-05-10  8:09           ` Helmut Eller
2024-05-10  8:35             ` Gerd Möllmann
2024-05-10  8:51               ` Helmut Eller
2024-05-10  8:54                 ` Gerd Möllmann
2024-05-10 10:25             ` Eli Zaretskii
2024-05-10 11:31               ` Gerd Möllmann
2024-05-10 12:52                 ` Gerd Möllmann
2024-05-10 13:37                   ` Helmut Eller
2024-05-10 13:59                     ` Gerd Möllmann
2024-05-10 14:31                       ` Helmut Eller
2024-05-10 14:36                         ` Gerd Möllmann
2024-05-13  9:11                   ` Gerd Möllmann
2024-05-14  8:23                     ` Gerd Möllmann
2024-05-14 14:22                       ` Helmut Eller
2024-05-14 15:46                         ` Gerd Möllmann
2024-05-14 17:49                           ` Eli Zaretskii
2024-05-14 18:10                             ` Gerd Möllmann
2024-05-16  4:25                       ` Gerd Möllmann
2024-05-16  8:36                         ` Helmut Eller
2024-05-16  8:46                           ` Gerd Möllmann
2024-05-16  9:01                           ` Gerd Möllmann
2024-05-16  9:31                             ` Helmut Eller
2024-05-16  9:42                               ` Gerd Möllmann
2024-05-16  9:54                                 ` Gerd Möllmann
2024-05-16 12:43                                   ` Helmut Eller
2024-05-16 12:47                                     ` Gerd Möllmann
2024-05-16 12:08                                 ` Eli Zaretskii
2024-05-16 12:27                                   ` Gerd Möllmann
2024-05-16 12:07                               ` Eli Zaretskii
2024-05-16 12:21                                 ` Gerd Möllmann
2024-05-16 12:27                                   ` Eli Zaretskii
2024-05-16 12:43                                     ` Gerd Möllmann
2024-05-16 14:09                         ` Helmut Eller
2024-05-16 14:24                           ` Gerd Möllmann
2024-05-16 15:48                             ` Eli Zaretskii
2024-05-16 16:56                             ` Andrea Corallo
2024-05-16 17:27                               ` Gerd Möllmann
2024-05-16 17:50                                 ` Andrea Corallo
2024-05-16 20:03                                 ` Helmut Eller
2024-05-17  4:04                                   ` Gerd Möllmann
2024-05-17  6:09                                   ` Eli Zaretskii
2024-05-18 18:55                                     ` Helmut Eller
2024-05-18 20:16                                       ` Andrea Corallo
2024-05-19  5:27                                         ` Eli Zaretskii
2024-05-19  3:48                                       ` Gerd Möllmann
2024-05-19  6:39                                         ` Eli Zaretskii
2024-05-09 18:24       ` Gerd Möllmann
2024-05-09 18:35         ` Gerd Möllmann

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/emacs/

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

  git send-email \
    --in-reply-to=m2edabayyr.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).