From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: last_marked array is now ifdef'ed away Date: Sat, 14 Sep 2024 19:05:31 +0200 Message-ID: References: <86zfokyp64.fsf@gnu.org> <86ed5pkz53.fsf@gnu.org> <851C7C12-44A1-4661-9EA7-16B0B7209D11@gmail.com> <86a5gbk295.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20253"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 14 19:06:50 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 1spWEU-00050R-DF for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Sep 2024 19:06:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spWDg-0002JI-IC; Sat, 14 Sep 2024 13:06:00 -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 1spWDM-0002IU-Gc for emacs-devel@gnu.org; Sat, 14 Sep 2024 13:05:40 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spWDJ-0005RD-0f; Sat, 14 Sep 2024 13:05:38 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2f74e613a10so26380071fa.1; Sat, 14 Sep 2024 10:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726333534; x=1726938334; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=VjQ0QcPfwn17wBQcITwuHhHJFtOCoYI58OdPnuYLFi8=; b=c785L5z1U0NoaIU+herb24E2hWVZRKEtDwzJc9rcPCbUciiZoCoUomeZ1RL5/hBNGe ldJhUNhk7Jsm9I6tBk47ZWPBdnpbE3s583OujUdRK8GieZUw9c0/q26WX1VBH0WI/IQp SXztLFbrmi3ysWTiF6FjWezyMhfJIMm2QRh/PgLxyOGSS1onaIhT2jh+XkJJsWdfHlIy MOexn3ED4X0mGmqLS4Wuu+YMfFvy+NUsNBYZTXROJrd0NfgDbNM4qOQx8jLnpwgio7Wo ev0Mvtnp4CFkZGwdyQBECQO5u+SCJMIFfhLjWMIkCRvw6R+V92R70WScxxnkFov7Cb2r s3Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726333534; x=1726938334; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VjQ0QcPfwn17wBQcITwuHhHJFtOCoYI58OdPnuYLFi8=; b=LF1tR2tvf1OvF5er0zcvsZYX+u4iIqSt+3tZKYz2yyj2/jp5z2baJLPzFlFH4gIbkZ 8jafe5W5Zy05HzWLynPbjzGzlBQrHiKa5oI+gLPlsZ0MQtmG2DcSpoGUZfR8tzAgjVFO 8qsD0WdDuI9dlCi248rT0BahILbiQHxev9QDkLV7+ZZesZKLCXtLbMJ5etYphg+LPwbT PCklG2hvclUgsPI9T1U87xzVL/Kz4e8gK1IHwHPTmfsEbYwhY+JO2dF3/9fJnDlGw0wm h/YgRhoI6mHQPSa4goYn/so7+0M8SmRkBqoRFafc60UsraML5SSQQf2rwfwvk1bRjObN YWXw== X-Gm-Message-State: AOJu0Yz9K+2Z81zoA6xLXUdxC0tvNCMv/2CnR1lFutjsC0cALlf0dyD3 zNgBXJ7weUUzcHkVeoBfb3FV4aEk99BZXMuyoiDqkNf3sESgQqpMHCcp8g== X-Google-Smtp-Source: AGHT+IGCDm78Izkm7eIUkUzfGOmUsfsa2gj60P6h+M0Uz+A6USAKT166cDkyR2dMbGewS0aGPkUbrQ== X-Received: by 2002:a2e:a98a:0:b0:2f3:eca4:7c32 with SMTP id 38308e7fff4ca-2f791b663cfmr46982161fa.38.1726333533306; Sat, 14 Sep 2024 10:05:33 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se. [188.150.191.82]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f79d2e1dbdsm2935731fa.14.2024.09.14.10.05.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Sep 2024 10:05:32 -0700 (PDT) In-Reply-To: <86a5gbk295.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=mattias.engdegard@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:323617 Archived-At: 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). It surprised me how expensive this silly thing is: enabling = GC_REMEMBER_LAST_MARKED made GC 4.5-6.5 % slower in some simple = benchmarks, and the difference showed up in some actual useful work type = of code that I measured. 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.) 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.