From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: dangling markers Date: Sun, 30 Jun 2024 19:02:07 +0000 Message-ID: References: <87v81u85hv.fsf@localhost> <87wmm75xze.fsf@localhost> <7YYJyDLCuZhtkTAT_ry6S14y4KoAJtsV_2Ui8Dsy37afuN1zucoO6VPh6YAvKQCs-0OUP3-rTFogtJBLrv2wiZ9rq6lacV-p_M1qsSSgKOk=@protonmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_HgAAPPBSWFoFln4XCRmSqppOusKe6T7LueEtsoBDw" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5717"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org, eller.helmut@gmail.com To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 30 21:32:06 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 1sO0HN-0001Cw-2v for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jun 2024 21:32:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sO0Gg-0004Bw-Dw; Sun, 30 Jun 2024 15:31:23 -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 1sNzod-0006et-C0 for emacs-devel@gnu.org; Sun, 30 Jun 2024 15:02:24 -0400 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 1sNzoW-0007gb-HD; Sun, 30 Jun 2024 15:02:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719774132; x=1720033332; bh=6KNWs15LEn9zqstIgCneQ091aN1yj+Fk3NneQDmh3GM=; 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; b=aCiaEdLB+g6WamrmlrPc+9aTLEBe8Eq3XX8hT4WJ/4rrYt1yuKdEnlfEJU0myqyWT xhbwE2eZPHxvPcM7XDna0Pkp/K50P2Slh+HamphvdTAHsO+kP0sGvpEWH3g5YL8QZo ItopPvEJ8aDqDpXWpUgeqlcSNOVnWx9KbhA2kfGh5pg0iPVk8Q3u5f7N9VIOv6x5es FVdkgGLYwCXEwk7aWgnad4vAIWnjT7FtkHj9DjIo29Gn+6z8SzpXvRdGU8Dnq3XKX4 GHfBZBOqg5gj1KEmEJvyhkm90aLyr+VOIn7n5gXbobKp/AMdc/9VD2e3XaHbGh6ZVb kXnMHflcRzN3A== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 456c565890bfecf112b5aacda20cd0a62071b480 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_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 Jun 2024 15:31:17 -0400 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:320980 Archived-At: This is a multi-part message in MIME format. --b1_HgAAPPBSWFoFln4XCRmSqppOusKe6T7LueEtsoBDw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sunday, June 30th, 2024 at 13:15, Gerd M=C3=B6llmann wrote: > Pip Cet pipcet@protonmail.com writes: >=20 > > > True. I forgot to mention an important thing: When something is splat= , > > > set flag(s) in the dependent hash table indicating that something mus= t > > > be done because of that splatting. In gethash and so, check the flag = and > > > do what's necessary. (I did something similar for the weak hash table= s > > > in CMUCL, and it wasn't entirely bad. And weak tables should be rare.= ) > >=20 > > Not necessarily rare, particularly not if we turn BUF_MARKERS into a > > weak hash table (I still don't see why we shouldn't do that, maybe I > > missed it). >=20 >=20 > Hm, don't know. On the one hand, there's Stefan's gap buffer data > structure, and on the other hand add_marker and remove_marker are now > O(1) in igc, modulo bugs. So the pressure has decreased. Well, I needed a weak hash table to test things on, which is why I've inclu= ded the change in the attached patch. > > But, yes, that's a good idea and requires far fewer changes to the > > hash table code than I've now made locally. However, I've decided to > > go through with it and have just successfully splatted my first weak > > hash table entry. >=20 > Congrats! :-). I have to say, my ideas are idle musings, that I'll > probably never realize. Working code wins :-). I've implemented weak-key hash tables for the scratch/igc branch. Like existing hash tables, the tables themselves never shrink automatically, but can grow; entries can be removed by GC as well as manually, and the table's apparent size will change immediately. Unfortunately, much of the hash table code had to be duplicated: weak hash tables are now composed of two objects which, in MPS language, are "dependent objects" of each other: this means that when an entry in a weak hash table is being removed during GC, we must not modify anything except non-MPS memory and at most one object in addition to the one being scanned. It's possible to make strong hash tables a (boring) special case of weak hash tables, but that seems backwards to me: strong hash tables need to be fast, and they're the normal case, so extra indirection to make them behave more like the limited weak hash table case is worse than duplicating some code. There's a lot of boring TODO work: * make them readable in lread.c * restore them properly from the dump rather than, as the current code doe= s, making and keeping them strong * user-defined hash functions * weak-value hash tables * stop wasting quite as much memory by overallocating everything Some intermediately-interesting TODO work: * key-and-value hash table weakness And one very challenging item: * key-or-value hash table weakness My understanding of the latter is that a reference to, say, the value would need to keep the entire key/value pair alive. I'm not sure how to do that with MPS, and I'm afraid the best course of action may be to deprecate this rare feature. (Of course, one possible implementation is to add another word to the IGC header to keep alive a list of value-or-keys associated with this key-or-value, but that seems disproportionately expensive). There is a special optimization that MPS performs on 32-bit x86 systems whi= ch requires all words of objects in our weak pool to be either misaligned or valid pointers to (in our case) a struct igc_header. There's some initial work toward supporting that, but the patch will probably not work on 32-bit x86. More TODO: * iterating over a weak hash table may be interrupted by GC. What happens = then? * restore the weak vector code for Lisp_Marker, as Gerd indicated he prefe= rs that to using a weak hash table. I removed it so we'd actually be workin= g with weak hash tables. Anyway, just thought sharing a snapshot of the current code might make disc= ussing things easier. Patch is against b278c7ede95816ba972f64647b68d05d88cc9f18. Pip --b1_HgAAPPBSWFoFln4XCRmSqppOusKe6T7LueEtsoBDw Content-Type: text/x-patch; name=0002-mps-weak-hash-tables.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0002-mps-weak-hash-tables.patch ZGlmZiAtLWdpdCBhL3NyYy9hbGxvYy5jIGIvc3JjL2FsbG9jLmMKaW5kZXggMDliNTFiYTJhMDgu LjVkNDdkM2Y3ODUxIDEwMDY0NAotLS0gYS9zcmMvYWxsb2MuYworKysgYi9zcmMvYWxsb2MuYwpA QCAtNjIzMCw2ICs2MjMwLDE2IEBAIHB1cmVjb3B5IChMaXNwX09iamVjdCBvYmopCiAKICA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cm9uZy0+ZW50cmllcyArIDMg KiBzaXplOworICByZXQtPndlYWsgPSBpZ2NfYWxsb2Nfd2Vha19oYXNoX3RhYmxlX3dlYWtfcGFy dCAod2Vhaywgc2l6ZSwgaW5kZXhfYml0cyk7CisgIHJldC0+c3Ryb25nLT53ZWFrID0gcmV0LT53 ZWFrOworICByZXQtPndlYWstPnN0cm9uZyA9IHJldC0+c3Ryb25nOworICByZXQtPnN0cm9uZy0+ a2V5ID0gcmV0LT53ZWFrLT5lbnRyaWVzOworICByZXR1cm4gcmV0OworfQorCitMaXNwX09iamVj dAorc3RyZW5ndGhlbl9oYXNoX3RhYmxlIChMaXNwX09iamVjdCB3ZWFrKQoreworICBMaXNwX09i amVjdCByZXQgPSBtYWtlX2hhc2hfdGFibGUgKFhXRUFLX0hBU0hfVEFCTEUgKHdlYWspLT5zdHJv bmctPnRlc3QsIDAsIFdlYWtfTm9uZSwgMCk7CisKKyAgTGlzcF9PYmplY3QgaywgdjsKKyAgRE9I QVNIX1dFQUsgKFhXRUFLX0hBU0hfVEFCTEUgKHdlYWspLCBrLCB2KQorICAgIHsKKyAgICAgIEZw dXRoYXNoIChrLCB2LCByZXQpOworICAgIH0KKworICByZXR1cm4gcmV0OworfQorCitMaXNwX09i amVjdAorc3RyZW5ndGhlbl9oYXNoX3RhYmxlX2Zvcl9kdW1wIChzdHJ1Y3QgTGlzcF9XZWFrX0hh c2hfVGFibGUgKndlYWspCit7CisgIGlmICghTklMUCAod2Vhay0+ZHVtcF9yZXBsYWNlbWVudCkp CisgICAgcmV0dXJuIHdlYWstPmR1bXBfcmVwbGFjZW1lbnQ7CisgIExpc3BfT2JqZWN0IHJldCA9 IHN0cmVuZ3RoZW5faGFzaF90YWJsZSAobWFrZV9saXNwX3dlYWtfaGFzaF90YWJsZSAod2Vhaykp OworICB3ZWFrLT5kdW1wX3JlcGxhY2VtZW50ID0gcmV0OworCisgIHJldHVybiByZXQ7Cit9CisK IC8qIENvbXB1dGUgdGhlIHNpemUgb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ICAgfQorfQorCiAMCiAvKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJ CQkgICBXZWFrIEhhc2ggVGFibGVzCkBAIC01OTIwLDYgKzYyODYsMTEgQEAgREVGVU4gKCJoYXNo LXRhYmxlLWNvdW50IiwgRmhhc2hfdGFibGVfY291bnQsIFNoYXNoX3RhYmxlX2NvdW50LCAxLCAx LCAwLAogICAgICAgIGRvYzogLyogUmV0dXJuIHRoZSBudW1iZXIgb2YgZWxlbWVudHMgaW4gVEFC TEUuICAqLykKICAgKExpc3BfT2JqZWN0IHRhYmxlKQogeworICBzdHJ1Y3QgTGlzcF9XZWFrX0hh c2hfVGFibGUgKndoID0gY2hlY2tfbWF5YmVfd2Vha19oYXNoX3RhYmxlICh0YWJsZSk7CisgIGlm ICh3aCkKKyAgICB7CisgICAgICByZXR1cm4gd2gtPnN0cm9uZy0+Y291bnQ7CisgICAgfQogICBz dHJ1Y3QgTGlzcF9IYXNoX1RhYmxlICpoID0gY2hlY2tfaGFzaF90YWJsZSAodGFibGUpOwogICBy ZXR1cm4gbWFrZV9maXhudW0gKGgtPmNvdW50KTsKIH0KQEAgLTU5OTksNyArNjM3MCw3IEBAIERF RlVOICgiaGFzaC10YWJsZS1wIiwgRmhhc2hfdGFibGVfcCwgU2hhc2hfdGFibGVfcCwgMSwgMSwg MCwKICAgICAgICBkb2M6IC8qIFJldHVybiB0IGlmIE9CSiBpcyBhIExpc3AgaGFzaCB0YWJsZSBv YmplY3QuICAqLykKICAgKExpc3BfT2JqZWN0IG9iaikKIHsKLSAgcmV0dXJuIEhBU0hfVEFCTEVf UCAob2JqKSA/IFF0IDogUW5pbDsKKyAgcmV0dXJuIChIQVNIX1RBQkxFX1AgKG9iaikgfHwgV0VB S19IQVNIX1RBQkxFX1AgKG9iaikpID8gUXQgOiBRbmlsOwogfQogCiAKQEAgLTYwMDcsNiArNjM3 OCwxMiBAQCBERUZV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W4pOworCQlwcmludF9vYmplY3QgKGhhc2hfdGFibGVfd2Vha25lc3Nfc3ltYm9sIChoLT5z dHJvbmctPndlYWtuZXNzKSwKKwkJCSAgICAgIHByaW50Y2hhcmZ1biwgZXNjYXBlZmxhZyk7CisJ ICAgICAgfQorCisJICAgIC8qIFhYWDogc3RyZW5ndGhlbiBmaXJzdCwgdGhlbiBjb3VudCAqLwor CSAgICBwdHJkaWZmX3Qgc2l6ZSA9IFhGSVhOVU0gKGgtPnN0cm9uZy0+Y291bnQpOworCSAgICBp ZiAoc2l6ZSA+IDApCisJICAgICAgeworCQlwcmludF9jX3N0cmluZyAoIiBkYXRhICgiLCBwcmlu dGNoYXJmdW4pOworCisJCS8qIERvbid0IHByaW50IG1vcmUgZWxlbWVudHMgdGhhbiB0aGUgc3Bl Y2lmaWVkIG1heGltdW0uICAqLworCQlpZiAoRklYTkFUUCAoVnByaW50X2xlbmd0aCkgJiYgWEZJ WE5BVCAoVnByaW50X2xlbmd0aCkgPCBzaXplKQorCQkgIHNpemUgPSBYRklYTkFUIChWcHJpbnRf bGVuZ3RoKTsKKworCQlwcmludF9zdGFja19wdXNoICgoc3RydWN0IHByaW50X3N0YWNrX2VudHJ5 KXsKKwkJICAgIC50eXBlID0gUEVfaGFzaCwKKwkJICAgIC51Lmhhc2gub2JqID0gc3RyZW5ndGhl bl9oYXNoX3RhYmxlIChvYmopLAorCQkgICAgLnUuaGFzaC5ub2JqcyA9IHNpemUgKiAyLAorCQkg ICAgLnUuaGFzaC5pZHggPSAwLAorCQkgICAgLnUuaGFzaC5wcmludGVkID0gMCwKKwkJICAgIC51 Lmhhc2gudHJ1bmNhdGVkID0gKHNpemUgPCBYRklYTlVNIChoLT5zdHJvbmctPmNvdW50KSksCisJ CSAgfSk7CisJICAgICAgfQorCSAgICBlbHNlCisJICAgICAgeworCQkvKiBFbXB0eSB0YWJsZTog d2UgY2FuIG9taXQgdGhlIGRhdGEgZW50aXJlbHkuICAqLworCQlwcmludGNoYXIgKCcpJywgcHJp bnRjaGFyZnVuKTsKKwkJLS1wcmludF9kZXB0aDsgICAvKiBEb25lIHdpdGggdGhpcy4gICovCisJ ICAgICAgfQorCSAgICBnb3RvIG5leHRfb2JqOworCSAgfQorCiAJY2FzZSBQVkVDX0JJR05VTToK IAkgIHByaW50X2JpZ251bSAob2JqLCBwcmludGNoYXJmdW4pOwogCSAgYnJlYWs7Cg== --b1_HgAAPPBSWFoFln4XCRmSqppOusKe6T7LueEtsoBDw--