From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stefankangas@gmail.com, pipcet@protonmail.com, ofv@wanadoo.es,
emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org
Subject: Re: Some experience with the igc branch
Date: Sat, 28 Dec 2024 12:07:33 +0100 [thread overview]
Message-ID: <m2frm86p6y.fsf@gmail.com> (raw)
In-Reply-To: <86cyhcum5d.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Dec 2024 12:39:26 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: stefankangas@gmail.com, pipcet@protonmail.com, ofv@wanadoo.es,
>> emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org
>> Date: Fri, 27 Dec 2024 19:21:30 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > - Concurrent. The GC runs in its own thread. There are no explicit
>> > calls to start GC, and Emacs doesn't have to wait for the GC to
>> > complete.
>> >
>> > Pip says this is not true? I also thought MPS GC runs concurrently in
>> > its own thread.
>>
>> What Pip said was very easy to misunderstand, to say the least :-). No,
>> MPS is concurrent, period. There are situations in which MPS can, in
>> addition, use the main thread. And it's still concurrent, period.
>
> How can you see which thread runs MPS? Where should I put a
> breakpoint to see that (IOW, what are the entry points into MPS GC
> code)? If I run Emacs with a breakpoint in process_one_message (after
> enabling garbage-collection-messages), all I ever see is GC triggered
> by igc_on_idle, which AFAIU is only one of the way GC can be
> triggered. Where are the entry points for the other GC triggers? I'm
> asking because I'd like to run Emacs like that and see which thread(s)
> run GC.
I wonder if your interpretation is right here. AFAIR,
process_one_message is always called from igc_on_idle. IOW, we handle
messages from MPS only when Emacs thinks it's idle, and that is always
in the main thread.
The messages are produced and put into the MPS message queue in the MPS
thread, usually. Or maybe, I don't know that for a fact, also in the
main thread, when allocation points run out of memory, or when we do an
mps_arena_step. The arena step thing is only done if igc-step-interval
is non-zero, which is not the default. (I'm personally using 0.05 = 50
ms, BTW.)
How to get hold of the MPS thread I don't know. I just see one thread
more when using igc than with the old GC. Maybe one could sett a
breakpoint on that ArenaLock others mentioned, with the warning that I
don't know what I'm talking about when it comes to MPS internals.
>
>> > When copying objects, a marker is left in the original object pointing
>> > to its copy. This marker is also called a "tombstone". A "memory
>> > barrier" is placed on the original object. Memory barrier means the
>> > memory is read and/or write protected (e.g. with mprotect). The
>> > barrier leads to MPS being invoked when an old object is accessed.
>> > The whole process is called "object forwarding".
>> >
>> > This doesn't tell how object forwarding works once triggered by access
>> > to protected memory. Can you say something about that?
>> > This:
>> >
>> > MPS makes sure that references to old objects are updated to refer to
>> > their new addresses. Functions defined in the object format are used
>> > by MPS to perform the lowest-level tasks of object forwarding, so that
>> > MPS doesn't have to know application-specific details of how objects
>> > look like. In the end, copying/forwarding is transparent to the
>> > application.
>> >
>> > seems to try to explain that, but AFAIU stops short of telling it.
>> > IOW, how are "functions defined in the object format used by MPS to
>> > perform the lowest-level tasks of object forwarding"?
>> >
>>
>> I'm afraid I can't describe that in detals because it's an
>> implementation details of MPS itself. AFAIK, it's not documented, and I
>> don't read the sources of MPS.
>>
>> Object forwarding in general is not specific to MPS. Many copying
>> collectors use it. I tried to explain this as far as I could without
>> knowing the MPS implementation.
>>
>> Whether one should describe this in detail here is a valid question.
>> Maybe someone knowing the MPS implementation in detail could add that.
>
> I'm only interested in this insofar as it's relevant to the functions
> defined in igc.c. E.g., do any of the "scan" or "fix" function have
> anything to do with object forwarding? If so, I thought it would be
> useful to describe that, to help people understand the role of those
> functions and what their code needs to do.
MPS_FIX2 has to with it because it returns an object's new address which
we then can store where we got the old reference from. See
fix_lisp_object. Do you think mentioning that would suffice?
>> > MPS allows us to specify roots having tailor-made scan functions that
>> > Emacs implements. Scanning here refers to the process of finding
>> > references in the memory area of the root, and telling MPS about the
>> > references.
>> >
>> > What is the purpose of "telling MPS about the references"?
>>
>> If MPS were the old GC, it's like letting MPS do its mark_object.
>>
>> What about if it said "... telling MPS about the reference so that it
>> knows the references object is live", only expressed better?
>
> Sure, that's much better, because it makes this much more concrete.
👍
next prev parent reply other threads:[~2024-12-28 11:07 UTC|newest]
Thread overview: 198+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-22 15:40 Some experience with the igc branch Óscar Fuentes
2024-12-22 17:18 ` Gerd Möllmann
2024-12-22 17:29 ` Gerd Möllmann
2024-12-22 17:41 ` Pip Cet via Emacs development discussions.
2024-12-22 17:56 ` Gerd Möllmann
2024-12-22 19:11 ` Óscar Fuentes
2024-12-23 0:05 ` Pip Cet via Emacs development discussions.
2024-12-23 1:00 ` Óscar Fuentes
2024-12-24 22:34 ` Pip Cet via Emacs development discussions.
2024-12-25 4:25 ` Freezing frame with igc Gerd Möllmann
2024-12-25 11:19 ` Pip Cet via Emacs development discussions.
2024-12-25 11:55 ` Óscar Fuentes
2024-12-23 3:42 ` Some experience with the igc branch Gerd Möllmann
2024-12-23 6:27 ` Jean Louis
2024-12-22 20:29 ` Helmut Eller
2024-12-22 20:50 ` Gerd Möllmann
2024-12-22 22:26 ` Pip Cet via Emacs development discussions.
2024-12-23 3:23 ` Gerd Möllmann
[not found] ` <m234ieddeu.fsf_-_@gmail.com>
[not found] ` <87ttaueqp9.fsf@protonmail.com>
[not found] ` <m2frme921u.fsf@gmail.com>
[not found] ` <87ldw6ejkv.fsf@protonmail.com>
[not found] ` <m2bjx2h8dh.fsf@gmail.com>
2024-12-23 14:45 ` Make Signal handling patch platform-dependent? Pip Cet via Emacs development discussions.
2024-12-23 14:54 ` Gerd Möllmann
2024-12-23 15:11 ` Eli Zaretskii
2024-12-23 13:35 ` Some experience with the igc branch Eli Zaretskii
2024-12-23 14:03 ` Discussion with MPS people Gerd Möllmann
2024-12-23 14:04 ` Gerd Möllmann
2024-12-23 15:07 ` Some experience with the igc branch Pip Cet via Emacs development discussions.
2024-12-23 15:26 ` Gerd Möllmann
2024-12-23 16:03 ` Pip Cet via Emacs development discussions.
2024-12-23 16:44 ` Eli Zaretskii
2024-12-23 17:16 ` Pip Cet via Emacs development discussions.
2024-12-23 18:35 ` Eli Zaretskii
2024-12-23 18:48 ` Gerd Möllmann
2024-12-23 19:25 ` Eli Zaretskii
2024-12-23 20:30 ` Benjamin Riefenstahl
2024-12-23 23:39 ` Pip Cet via Emacs development discussions.
2024-12-24 12:14 ` Eli Zaretskii
2024-12-24 13:18 ` Pip Cet via Emacs development discussions.
2024-12-24 13:42 ` Benjamin Riefenstahl
2024-12-24 3:37 ` Eli Zaretskii
2024-12-24 8:48 ` Benjamin Riefenstahl
2024-12-24 13:52 ` Eli Zaretskii
2024-12-24 13:54 ` Benjamin Riefenstahl
2024-12-23 17:44 ` Gerd Möllmann
2024-12-23 19:00 ` Eli Zaretskii
2024-12-23 19:37 ` Eli Zaretskii
2024-12-23 20:49 ` Gerd Möllmann
2024-12-23 21:43 ` Helmut Eller
2024-12-23 21:49 ` Pip Cet via Emacs development discussions.
2024-12-23 21:58 ` Helmut Eller
2024-12-23 23:20 ` Pip Cet via Emacs development discussions.
2024-12-24 5:38 ` Helmut Eller
2024-12-24 6:27 ` Gerd Möllmann
2024-12-24 10:09 ` Pip Cet via Emacs development discussions.
2024-12-24 4:05 ` Gerd Möllmann
2024-12-24 8:50 ` Gerd Möllmann
2024-12-24 6:03 ` SIGPROF + SIGCHLD and igc Gerd Möllmann
2024-12-24 8:23 ` Helmut Eller
2024-12-24 8:39 ` Gerd Möllmann
2024-12-25 9:22 ` Helmut Eller
2024-12-25 9:43 ` Gerd Möllmann
2024-12-24 13:05 ` Eli Zaretskii
2024-12-25 10:46 ` Helmut Eller
2024-12-25 12:45 ` Eli Zaretskii
2024-12-24 12:54 ` Eli Zaretskii
2024-12-24 12:59 ` Gerd Möllmann
2024-12-27 8:08 ` Helmut Eller
2024-12-27 8:51 ` Eli Zaretskii
2024-12-27 14:53 ` Helmut Eller
2024-12-27 15:09 ` Pip Cet via Emacs development discussions.
2024-12-27 15:19 ` Eli Zaretskii
2024-12-27 8:55 ` Gerd Möllmann
2024-12-27 15:40 ` Helmut Eller
2024-12-27 15:53 ` Gerd Möllmann
2024-12-27 11:36 ` Pip Cet via Emacs development discussions.
2024-12-27 16:14 ` Helmut Eller
2024-12-28 10:02 ` Helmut Eller
2024-12-28 10:50 ` Eli Zaretskii
2024-12-28 13:52 ` Helmut Eller
2024-12-28 14:25 ` Eli Zaretskii
2024-12-28 16:46 ` Helmut Eller
2024-12-28 17:35 ` Eli Zaretskii
2024-12-28 18:08 ` Helmut Eller
2024-12-28 19:00 ` Eli Zaretskii
2024-12-28 19:28 ` Helmut Eller
2024-12-28 19:32 ` Pip Cet via Emacs development discussions.
2024-12-28 19:51 ` Helmut Eller
2024-12-23 23:37 ` Some experience with the igc branch Pip Cet via Emacs development discussions.
2024-12-24 4:03 ` Gerd Möllmann
2024-12-24 10:25 ` Pip Cet via Emacs development discussions.
2024-12-24 10:50 ` Gerd Möllmann
2024-12-24 13:15 ` Eli Zaretskii
2024-12-24 12:26 ` Eli Zaretskii
2024-12-24 12:56 ` Gerd Möllmann
2024-12-24 13:19 ` Pip Cet via Emacs development discussions.
2024-12-24 13:38 ` Gerd Möllmann
2024-12-24 13:46 ` Eli Zaretskii
2024-12-24 14:12 ` Gerd Möllmann
2024-12-24 14:40 ` Eli Zaretskii
2024-12-25 4:56 ` Gerd Möllmann
2024-12-25 12:19 ` Eli Zaretskii
2024-12-25 12:50 ` Gerd Möllmann
2024-12-25 13:00 ` Eli Zaretskii
2024-12-25 13:08 ` Gerd Möllmann
2024-12-25 13:26 ` Eli Zaretskii
2024-12-25 14:07 ` Gerd Möllmann
2024-12-25 14:43 ` Helmut Eller
2024-12-25 14:59 ` Eli Zaretskii
2024-12-25 20:44 ` Helmut Eller
2024-12-26 6:29 ` Eli Zaretskii
2024-12-26 8:02 ` Helmut Eller
2024-12-26 9:32 ` Eli Zaretskii
2024-12-26 12:24 ` Helmut Eller
2024-12-26 15:23 ` Eli Zaretskii
2024-12-26 23:29 ` Paul Eggert
2024-12-27 7:57 ` Eli Zaretskii
2024-12-27 19:34 ` Paul Eggert
2024-12-28 8:06 ` Eli Zaretskii
2024-12-28 20:44 ` Paul Eggert
2024-12-25 15:02 ` Gerd Möllmann
2024-12-25 13:09 ` Eli Zaretskii
2024-12-25 13:46 ` Gerd Möllmann
2024-12-25 14:37 ` Eli Zaretskii
2024-12-25 14:57 ` Gerd Möllmann
2024-12-25 15:28 ` Eli Zaretskii
2024-12-25 15:49 ` Gerd Möllmann
2024-12-25 17:26 ` Eli Zaretskii
2024-12-26 5:25 ` Gerd Möllmann
2024-12-26 7:43 ` Eli Zaretskii
2024-12-26 7:57 ` Gerd Möllmann
2024-12-26 11:56 ` Eli Zaretskii
2024-12-26 15:27 ` Stefan Kangas
2024-12-26 19:51 ` Gerd Möllmann
2024-12-27 9:45 ` Gerd Möllmann
2024-12-27 13:56 ` Gerd Möllmann
2024-12-27 15:01 ` Pip Cet via Emacs development discussions.
2024-12-27 15:28 ` Eli Zaretskii
2024-12-27 15:47 ` Pip Cet via Emacs development discussions.
2024-12-27 16:18 ` Gerd Möllmann
2024-12-28 9:10 ` Stefan Kangas
2024-12-28 9:20 ` Gerd Möllmann
2024-12-28 9:24 ` Gerd Möllmann
2024-12-27 16:05 ` Gerd Möllmann
2024-12-27 17:00 ` Pip Cet via Emacs development discussions.
2024-12-27 16:37 ` Eli Zaretskii
2024-12-27 17:26 ` Pip Cet via Emacs development discussions.
2024-12-27 19:12 ` Gerd Möllmann
2024-12-28 7:36 ` Eli Zaretskii
2024-12-28 12:35 ` Pip Cet via Emacs development discussions.
2024-12-28 12:51 ` Gerd Möllmann
2024-12-28 13:13 ` Eli Zaretskii
2024-12-28 9:29 ` Eli Zaretskii
2024-12-28 13:12 ` Pip Cet via Emacs development discussions.
2024-12-28 14:08 ` Eli Zaretskii
2024-12-27 18:21 ` Gerd Möllmann
2024-12-27 19:23 ` Pip Cet via Emacs development discussions.
2024-12-27 20:28 ` Gerd Möllmann
2024-12-28 10:39 ` Eli Zaretskii
2024-12-28 11:07 ` Gerd Möllmann [this message]
2024-12-28 11:23 ` Gerd Möllmann
2024-12-28 14:04 ` Pip Cet via Emacs development discussions.
2024-12-28 14:25 ` Gerd Möllmann
2024-12-28 16:27 ` Eli Zaretskii
2024-12-28 6:08 ` Gerd Möllmann
2024-12-25 17:40 ` Pip Cet via Emacs development discussions.
2024-12-25 17:51 ` Eli Zaretskii
2024-12-26 15:24 ` Pip Cet via Emacs development discussions.
2024-12-26 15:57 ` Eli Zaretskii
2024-12-27 14:34 ` Pip Cet via Emacs development discussions.
2024-12-27 15:58 ` Eli Zaretskii
2024-12-27 16:42 ` Pip Cet via Emacs development discussions.
2024-12-28 18:02 ` Eli Zaretskii
2024-12-26 5:27 ` Gerd Möllmann
2024-12-26 5:29 ` Gerd Möllmann
2024-12-24 21:18 ` Pip Cet via Emacs development discussions.
2024-12-25 5:23 ` Gerd Möllmann
2024-12-25 10:48 ` Pip Cet via Emacs development discussions.
2024-12-25 13:40 ` Stefan Kangas
2024-12-25 17:03 ` Pip Cet via Emacs development discussions.
2024-12-26 5:22 ` Gerd Möllmann
2024-12-26 7:33 ` Eli Zaretskii
2024-12-26 8:02 ` Gerd Möllmann
2024-12-26 15:50 ` Stefan Kangas
2024-12-26 16:13 ` Eli Zaretskii
2024-12-26 19:40 ` Gerd Möllmann
2024-12-26 17:01 ` Pip Cet via Emacs development discussions.
2024-12-26 19:45 ` Gerd Möllmann
2024-12-26 20:05 ` Eli Zaretskii
2024-12-26 20:12 ` Gerd Möllmann
2024-12-26 16:12 ` Stefan Kangas
2024-12-26 17:05 ` Eli Zaretskii
2024-12-25 11:48 ` Helmut Eller
2024-12-25 11:58 ` Gerd Möllmann
2024-12-25 12:52 ` Eli Zaretskii
2024-12-25 12:31 ` Eli Zaretskii
2024-12-25 12:54 ` Gerd Möllmann
2024-12-24 12:11 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2024-12-27 9:49 Sean Devlin
2024-12-27 12:34 ` Eli Zaretskii
2024-12-28 1:55 ` Sean Devlin
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=m2frm86p6y.fsf@gmail.com \
--to=gerd.moellmann@gmail.com \
--cc=acorallo@gnu.org \
--cc=eliz@gnu.org \
--cc=eller.helmut@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=ofv@wanadoo.es \
--cc=pipcet@protonmail.com \
--cc=stefankangas@gmail.com \
/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).