From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: New GC concept Date: Mon, 21 Jun 2021 15:58:20 -0700 Message-ID: <10670fe2-0c84-1990-b67b-b1f2215e17cb@dancol.org> References: <874ke9h97y.fsf@rfc20.org> <29607b7f-2286-c8c4-a693-cc715a4c26d4@grinta.net> <83k0n5f630.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35490"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii , Daniele Nicolodi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 22 01:01:14 2021 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 1lvSun-00094Z-J9 for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Jun 2021 01:01:14 +0200 Original-Received: from localhost ([::1]:49558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvSum-0004HT-FJ for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Jun 2021 19:01:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvSs7-00031b-Ik for emacs-devel@gnu.org; Mon, 21 Jun 2021 18:58:27 -0400 Original-Received: from dancol.org ([2600:3c01:e000:3d8::1]:56938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvSs4-0001UG-T6; Mon, 21 Jun 2021 18:58:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PQWcc2PCBzrxZJeujK7NEO2+VuStpLM8DayVA9sOH4g=; b=eit9JelKZG6ol7TSSYoZ/ZL7bZ rBTgyBpNg8wJfweV5sVFZS1Kkl0gyOXEVmX9ByhPwcEeaMCC/vqRrregvpsN3jqNuzrmp6BLJdQKh Sz2RNW37A16KMeBCotiJA1quqYEBgfjFaA24ZKzv/N4deVUQHKdUSV0Yfaxd1kVgtubhaUb4D+1ag vnye91RsNan8BWHoajCo6c+lphvs0cNUQbEgsPRJZMT2fYg0y7NWiImOO8LjLkxjCWhf0ETUNki4S m08VT+CA14yf24OvA5muJcogXNRgkDOOmp3vjTb4Gu5Q5lz6f/Whcal064yJyWcpbw1RhfADPIXJW +sPnv1wQ==; Original-Received: from [2604:4080:1321:8020:2761:c5fe:e373:3ed] (port=37028) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lvSs0-0002Ds-Hg; Mon, 21 Jun 2021 15:58:20 -0700 In-Reply-To: <83k0n5f630.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2600:3c01:e000:3d8::1; envelope-from=dancol@dancol.org; helo=dancol.org 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, NICE_REPLY_A=-0.001, SPF_HELO_PASS=-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.23 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" Xref: news.gmane.io gmane.emacs.devel:270975 Archived-At: On 6/7/21 7:22 PM, Eli Zaretskii wrote: >> From: Daniele Nicolodi >> Date: Mon, 7 Jun 2021 21:51:45 +0200 >> >>> We can definitely replace the existing GC with the new GC everywhere. >>> I've designed the new GC to work on systems without virtual memory >>> facilities. On these systems, we'll have to run the GC in >>> non-concurrent, non-generational mode, but that's no regression from >>> what we have today. We'll also probably want to use a smaller block size >>> on these systems to reduce fragmentation overhead. >> Isn't DOS the only system in this class? (It is not a rhetorical >> question: a while ago I asked which systems are officially supports and >> the answer was that all systems that currently run Emacs are supported). >> >> Does it make sense to still support DOS? > The development environment which is used to build the MS-DOS port of > Emacs (DJGPP) does support virtual memory (IIUC what that means in > this context). Oh, right. I completely forgot that we have DPMI. It's been a very long time since I looked at that. Does DJGPP provide DPMI 0.9 or 1.0? To get generational GC under DJGPP, we'll need something like a SIGSEGV handler, a bit of code that we run when the CPU signals a memory protection fault. I think we get there by installing an exception interrupt handler, as in http://www.delorie.com/djgpp/doc/dpmi/ch4.5.html, and I think it'll work in both DPMI 0.9 and 1.0. Another thing we need for generational GC is the ability to mark a range of pages read-only, as with mprotect. I think DPMI gives us the ability to change page permissions, but 0.9 does not. See http://www.delorie.com/djgpp/doc/dpmi/api/310507.html The other thing we get with VM is the ability to swap the from-space and the to-space without an additional memory copy. DPMI 1.0 appears to provide a shared memory facility that would let us do that (the equivalent of mmap/MapViewOfFile of an anonymous segment), but I'm not sure that DPMI 0.9 gives us that ability. Anyway, even if it is theoretically possible to implement the new GC's fancy VM stuff in terms of DPMI, I think it should have lower priority than the rest of the system. The new GC run without virtual memory use at all should still be no worse overall than the current GC, so MS-DOS Emacs at least wouldn't see a regression if we switched to a version of the new GC that didn't understand DPMI. But DPMI support for the new GC would definitely be a fun retro computing project.