From: Eli Zaretskii <eliz@gnu.org>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: gerd.moellmann@gmail.com, pipcet@protonmail.com, ofv@wanadoo.es,
emacs-devel@gnu.org, acorallo@gnu.org
Subject: Re: Some experience with the igc branch
Date: Thu, 26 Dec 2024 11:32:06 +0200 [thread overview]
Message-ID: <861pxuzt61.fsf@gnu.org> (raw)
In-Reply-To: <877c7mzxbw.fsf@gmail.com> (message from Helmut Eller on Thu, 26 Dec 2024 09:02:11 +0100)
> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: gerd.moellmann@gmail.com, pipcet@protonmail.com, ofv@wanadoo.es,
> emacs-devel@gnu.org, acorallo@gnu.org
> Date: Thu, 26 Dec 2024 09:02:11 +0100
>
> On Thu, Dec 26 2024, Eli Zaretskii wrote:
>
> >> Your position is that blocking SIGPROF while MPS holds the lock is
> >> the correct thing to do, right?
> >
> > Yes, I think so. (If you disagree, please tell why, and let's discuss
> > that.) It is certainly a relatively simple thing to do.
>
> I quite like Pip's proposal of re-installing the SIGSEGV handler with an
> additional sa_mask argument to block other signals. That would be nice
> because a) we can do that without changing MPS and b) it's likely more
> efficient than callbacks.
Are we sure doing so will solve the problem? AFAIU, MPS can take the
lock before SIGSEGV is delivered, or without its being delivered at
all, isn't that so?
(Besides, the sa_mask way won't work on Windows, which doesn't have
sigaction and its emulation currently ignores sa_mask; we'd need to
extend the emulation, but that will still leave a small window where
the other signals are not immediately blocked after SIGSEGV.)
> It would still be nice to simplify some signal handlers, like
> handle_interrupt_signal, but with other signals blocked for SIGSEGV, it
> would all be quite independent of MPS.
Maybe. What bothers me more is whether the signals are delivered only
to the main thread or to other threads. AFAIU, this behavior is
system-dependent, and currently we seem to rely on the fact that the
signals is delivered to the main thread. Given that we have other
threads, including the MPS thread, I'm not sure we have this figured
out.
> > It is also possible for MPS to somehow manage an attempt to take the
> > lock which is already held in a smarter way, by stopping the code
> > which does that until MPS releases the lock. For example, MPS could
> > define a protocol for such situations not unlike the GIL protocol we
> > use for Lisp threads. But that's much more complex, and I don't
> > necessarily expect the MPS folks to go to such lengths.
>
> I think that mps_arena_busy, which tests whether MPS holds the lock, is
> quite adequate for the SIGPROF handler. It lets us detect the situation
> and increment some counter.
I'd like to have MPS folks confirm that. The documentation of this
function seems to say we shouldn't use it "normally", only for
debugging (so perhaps in some commands in .gdbinit). And see also
this warning in their docs:
Warning: This function only gives a reliable result in
single-threaded programs, and in multi-threaded programs where
all threads but one are known to be stopped (as they are when
the debugger is decoding the call stack in the use case
described above).
AFAIU, Emacs doesn't fulfill the condition they define.
Also, the code we currently have on the branch doesn't just "increment
some counter", it flatly blocks the signal.
For these reasons, I'm not happy with our current usage of that
function for this purpose.
next prev parent reply other threads:[~2024-12-26 9:32 UTC|newest]
Thread overview: 135+ 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-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 [this message]
2024-12-26 12:24 ` Helmut Eller
2024-12-26 15:23 ` Eli Zaretskii
2024-12-26 23:29 ` 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-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-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
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=861pxuzt61.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=acorallo@gnu.org \
--cc=eller.helmut@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=gerd.moellmann@gmail.com \
--cc=ofv@wanadoo.es \
--cc=pipcet@protonmail.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).