From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Some experience with the igc branch Date: Tue, 24 Dec 2024 10:09:04 +0000 Message-ID: <87frmdbdgv.fsf@protonmail.com> References: <87o713wwsi.fsf@telefonica.net> <864j2u442i.fsf@gnu.org> <875xna6pnt.fsf@gmail.com> <87r05yax5a.fsf@protonmail.com> <87ttau5afi.fsf@gmail.com> <87msgmasx7.fsf@protonmail.com> <87y105od31.fsf@gmail.com> Reply-To: Pip Cet Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18451"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?Gerd_M=C3=B6llmann?= , Eli Zaretskii , ofv@wanadoo.es, emacs-devel@gnu.org, acorallo@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 24 12:59:41 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 1tQ3Zd-0004gU-59 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 12:59:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ3Yv-0002MV-8e; Tue, 24 Dec 2024 06:58:57 -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 1tQ1qh-0006wK-O6 for emacs-devel@gnu.org; Tue, 24 Dec 2024 05:09:11 -0500 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQ1qf-0004zQ-De for emacs-devel@gnu.org; Tue, 24 Dec 2024 05:09:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735034947; x=1735294147; bh=fIMc6qC/Qo86HU3zuYn/rE04pu/WX6VEhbRKWsLN3vs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=DKlSSzzkzukvvkaPZshGD3DIpMJAlx2LsHJjeDIrBflj7F/oLRTSmjnqxxf0Nx4KL ZLcJoyxiPnZaD/tXBcoEjSHllgZ5rwtVH+SmJ96BxFYrKX04AA3sTNX7uLM/fAVvz/ aKo5iWhcODTNzWoWHB67S+MW31wdxhl1AUrrjmFn4io2mA6PMOwGr4/h5igHIiKpP6 l0cr5oW/QtzaCV9W1x5q2yU7MXI6EaMmd1LFu1hjTwhuadxEJWHF5Js0dcTDAeOftu 4NrAV15s39EPKMLk1ilXUV653OSnAP0prS8BV5eLoHvy1heuar753wE5VI7uaBRoEn ynINE8jgLzkqw== In-Reply-To: <87y105od31.fsf@gmail.com> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 2d834e19309a07ce83e3a5dd84705cd5e36da897 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 24 Dec 2024 06:58:53 -0500 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:326991 Archived-At: "Helmut Eller" writes: > On Mon, Dec 23 2024, Pip Cet wrote: > >>> sxhash_eq doesn't fly with headerless objects. >> >> Which objects would that be? >> >> Right now all IGC objects have headers, right? Did I miss any? > > Right, but I'd like to keep that option on the table. I see one specific case where it would be useful: storing 64-bit integers on 32-bit systems. We don't need the entire integer range, since -256M .. +256M - 1 are fixnums (assuming we reduce fixnum range by 1 bit). So we have 512M unused values, which is precisely the number of possible forwarding pointers if we maintain 8-byte alignment. We can use two "impossible" forwarding pointers for 1-word padding and N-word padding, so this case works out precisely. No hash problems, since a u64 is constant and we can hash the contents instead. The only relevant 2-word object is conses, and I don't see a way to do it for them. Most N-word objects with N>2 are either fairly large to begin with, or they're vectorlikes and we have a redundant size field, which we can get rid of. >>> It should be obsoleted, IMO. > > [...] >> That leaves conses. My guess so far was that you wanted to implement a >> hack where a headerless cons is a two-word object that would turn into a >> tagged pointer to another two-word object with a header as soon as its >> hash value is taken. That requires slowing down either XCAR or XCDR, I >> think, and that's sufficient reason for me not to do it, but I guess I >> misunderstood your plans. This would also mean sxhash_eq would allocate >> memory, so it couldn't be called from a signal handler without yet >> another workaround. > > I would go the obvious way: use segregated allocation. Each Lisp_Type > gets its own MPS pool, without igc-headers. The dflt pool would only Why bother for non-conses? > contain non-lisp types, like IGC_OBJ_STRING_DATA, with igc-headers. > That wouldn't slow down XCAR, but it requires that hash tables use MPS's > location dependencies. I don't think we want to use location dependencies: even if we solved all the other problems (Fsxhash_eq, permanent hashes for those places where we can't rehash), I'm pretty sure rehashing would kill us. In particular, if we somehow managed to make GC more fine-grained and move fewer objects, we'd end up rehashing more, so suddenly we'd have an incentive not to use minor GCs. But I confess that I haven't looked at the location dependency code. There's no need for us to use it, and from the documentation it seemed it wouldn't be a good idea to start using it if you don't have to. (Also, at that point, shouldn't we just use an AMS pool for conses?) Pip