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: last_marked array is now ifdef'ed away Date: Sat, 14 Sep 2024 20:30:13 +0300 Message-ID: <8634m2f8ii.fsf@gnu.org> References: <86zfokyp64.fsf@gnu.org> <86ed5pkz53.fsf@gnu.org> <851C7C12-44A1-4661-9EA7-16B0B7209D11@gmail.com> <86a5gbk295.fsf@gnu.org> 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="38414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 14 19:31:05 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 1spWbw-0009kf-NF for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Sep 2024 19:31:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spWbG-0006YS-Ut; Sat, 14 Sep 2024 13:30:22 -0400 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 1spWbE-0006YH-VL for emacs-devel@gnu.org; Sat, 14 Sep 2024 13:30:21 -0400 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 1spWbD-0008Dx-8T; Sat, 14 Sep 2024 13:30:20 -0400 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=8cVFsG/KwG/cwmYR5dajrrZWJ8sbGSzW1WbX406K0R0=; b=cqS2duxSu7VToNa7lL/l lGBagKZgJveiFJE7xqGkq9cp6kOQdtGc8dZz6xEezv57vskRRURtXAqChA4ydfwOnbLWC/MutWoV9 Y4EYEgkdbVoI6K+I/pZWwJXwXsFF6mRIieytQy+w++Spw03aFVRFzHYsuwxhqj83zZy9B8mZUJr7p rZ/nmPtNv1yAUjuMeCicheGrTduPLKEs9jNNMHaRSn+zJq3rzshOZtOIaODCsIgsh9KIVxCU1PJPd DDaAiAxln4o6O0cIR0/3EQThc5klTX2K84f7Vs+KQfu0kzyoWWQnXxktOcjTp2fk2p+DXePmtOL0b H5h+F1diW8CPxg==; In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sat, 14 Sep 2024 19:05:31 +0200) 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:323618 Archived-At: > From: Mattias EngdegÄrd > Date: Sat, 14 Sep 2024 19:05:31 +0200 > Cc: emacs-devel@gnu.org > > 13 sep. 2024 kl. 17.21 skrev Eli Zaretskii : > > > But if a user reports a crash inside GC, that's basically the only > > trace we have to try and understand what caused the crash, especially > > if the debug info was stripped. That's why this code was always on by > > default. > > Yes, I understand that -- nevertheless it is a bit of a waste to spend time on something that is only rarely used (apparently it took over 2 years before anyone noticed, and I know you aren't one for keeping quiet about this sort of thing). That's the nature of things that are needed rarely. But when they _are_ needed, there's nothing to replace them, and that's when you appreciate their existence. Like safety belts, these features are never a waste. > And that is with LAST_MARKED_SIZE downgraded from the default 512 to just 16 which seemed more reasonable. (512 entries is 4 KiB of L1D cache which seems extravagant, but I presume the size wasn't given much thought at the time.) 16 is way too few. GC is deeply recursive, and when I used this, I almost always had to look at much more than 16 objects. > Perhaps it's not a big surprise after all: the GC marking loop has data-dependent branches and data-dependent loads, and we are likely to be bound by instructions in flight rather than execution resources; maybe any added instructions and memory traffic will just make it worse. > > > My main concern is not bitrot, it's actually being able to debug > > crashes inside GC. > > I'm quite sympathetic to that goal but it would be good if we could do it more cheaply. You can inspect the mark_stack structure; I've found this to help quite a bit. That's not the same, and doesn't show all the objects. I'm quite confident that I want this be turned on again.