From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Some experience with the igc branch Date: Tue, 24 Dec 2024 14:11:37 +0200 Message-ID: <86ttat2scm.fsf@gnu.org> References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> <864j2u442i.fsf@gnu.org> <87ldw6as5f.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28406"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 24 13:12:30 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQ3m1-0007BZ-5t for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 13:12:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ3lJ-0000l1-Gb; Tue, 24 Dec 2024 07:11:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQ3lG-0000ji-Hd for emacs-devel@gnu.org; Tue, 24 Dec 2024 07:11:42 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQ3lF-0004dA-C7; Tue, 24 Dec 2024 07:11:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=vMiabGZVLegSYYB/e2biNTiXXtrJ8/ujmbKvKFegBL8=; b=h+W0uFvDAd4+06kzw2W9 xe1J+h6fSwzjVO2oEfRYVWmqL8wGQTLCFGoHSKw1KM3on7kuFcf1HvUDP0RJdFScPAjLNWPIPwloq qOLZBhyI5Ej6DJNmNhgUZlp5/z5s4hF63MyeY5jy24MsjmSYofodwATgBQlrUMu3EvSPYdr3Bcp9l BYBSP0u/nXfGNHJPyErsQLZP7QS9YufkW7b09YZnHfyDL4gQHHNUpz61fQT9oQdMfWW2QrYWh3s9C wI+dgyLRX+HCIKdV/Qe4LkLkNDvLh+AFmeVnS/vkRpjmQ79G2WhuXaQZn27DLbfQmqBoeo6hvxu5s XLMx1S6HRojqAQ==; In-Reply-To: <87ldw6as5f.fsf@protonmail.com> (message from Pip Cet on Mon, 23 Dec 2024 23:37:13 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326993 Archived-At: > Date: Mon, 23 Dec 2024 23:37:13 +0000 > From: Pip Cet > Cc: Gerd Möllmann , ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org > > "Eli Zaretskii" writes: > > 1. which signal handlers want to read Lisp data > 2. which signal handlers want to write Lisp data > 3. which signal handlers want to allocate Lisp objects temporarily, > while guaranteeing no references to those objects survive when the > signal handler returns. > 4. which signal handlers want to allocate Lisp objects permanently, > storing references to the new objects in "old" data > 4a. ... and are willing to call a special transformation function to do > so > 4b. ... and want to do so implicitly, expecting memory manipulation to > "just work". > > 1: definitely works > 2: should work, but may hit a write barrier > 3: could be made to work if there's interest > 4a: if we must > 4b: see the other thread. If we have both make_object_writable > (formerly CHECK_IMPURE) and commit_object_changes functions and call > them consistently, it might be possible to find a way. > > > SIGPROF does (it's the basis for our Lisp profiler). > > That's 1, 2, but not 3 or 4, right? I don't think I understand your categories well enough, and anyway didn't look at the code to find out where it stops in that scale. > > SIGCHLD doesn't run Lisp (I think), but it examines objects and data > > structures of the Lisp machine (those related to child processes). > > Just 1, then? Ditto. It calls various functions, which I didn't trace into. > >> One thing I've seen done elsewhere is to publish a message to a message > >> board so that it can be handled outside of the signal handler. Something > >> like that, you know what I mean. > > > > This is tricky for the profiler, because you want to sample the > > function in which you are right there and then, not some time later. > > But would it be so bad to use a copy of the specpdl stack, placed in a > prepared area which is a GC root so we'd guarantee survival (but not > immutability; I don't think that matters in practice) of entries? > memcpy is safe to call from a signal handler, and then we could do all > of the processing safely. How will you ensure that the copied specpdl stack faithfully tells the profile info? It will most probably introduce bias into the profile.