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: MPS: staticpro everything Date: Fri, 03 May 2024 16:39:26 +0300 Message-ID: <868r0rhv5d.fsf@gnu.org> References: <86jzkdo9rm.fsf@gnu.org> <87jzkdfres.fsf@gmail.com> <86plu4mylj.fsf@gnu.org> <86msp8lbci.fsf@gnu.org> <86ikzwl8ih.fsf@gnu.org> <87r0ektkfo.fsf@yahoo.com> <86frv0l0ir.fsf@gnu.org> <86bk5okxfl.fsf@gnu.org> <867cgbjs1q.fsf@gnu.org> <87v83vnnxz.fsf@gmail.com> <86jzkbi15c.fsf@gnu.org> <86fruzhzpf.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="11083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, luangruo@yahoo.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 03 15:40:14 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 1s2t93-0002bk-LE for ged-emacs-devel@m.gmane-mx.org; Fri, 03 May 2024 15:40:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2t8U-0001gf-0V; Fri, 03 May 2024 09:39:38 -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 1s2t8Q-0001WB-R0 for emacs-devel@gnu.org; Fri, 03 May 2024 09:39:36 -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 1s2t8Q-0006SX-Hx; Fri, 03 May 2024 09:39:34 -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=THg/uzdl7ysnyop1si9yM3VRTdIoc3LAKmImBW9NE1A=; b=HGErNOoMjZQ8YNwZuH5B 4fIzII893nCVjcJKRAIBZCx1dvmnSSmnkLKIVlgq6zbZj6kFBMp3JqOGUcMqOmjw4TIEj+gCtPTN5 m0tGPwvpLjQ308w54N+Ye0nAWV1wyNyP3OgWpgtKap8J8KtC/LRTWWTgirajkziWCbJzZB6wlCNPW lZ9bMuvhQ1l3Up18vHoX+gnKQ59OY0tMnnOZsSKz1TORX7FrN1cnwW1fslecKWfxmTCw8AJv5KTMK Ml2OYRCCmTF+YWQvJ9qWF84WEgmri4MrS/9aTSYjr+Q6DPGWGZRUKIwtL2xLVg06W4QZWCItqm7XS B1WgYj9yb4L/1g==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Fri, 03 May 2024 14:21:26 +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:318682 Archived-At: > From: Gerd Möllmann > Cc: eller.helmut@gmail.com, luangruo@yahoo.com, emacs-devel@gnu.org > Date: Fri, 03 May 2024 14:21:26 +0200 > > Eli Zaretskii writes: > > >> I think you're overlooking that registers and stack are ambiguous roots. > >> The presence of u.s.data in a register or on the stack _prevents_ it > >> from moving. > > > > That doesn't resolve the difficulty, it just turns the table. Now we > > could have a race condition between the Lisp thread loading a pointer > > into a register or pushing it onto the C stack, and the MPS thread > > taking a notice that the pointer is in a register or on the stack. If > > the pointer was neither in a register nor on the stack when MPS > > started GC, it could decide to move the object, while the Lisp thread > > concurrently loads the pointer into a register. So we might think the > > object pointed to is unmovable while it isn't. > > > > What am I missing now? > > Here barriers come into play. Let's say, for simplicity, that we are > talking about an object on a VM page P. > > In its thread, MPS decides that it wants to do an increment of work on > P, say it wants to move objects, without the chance that MPS and client > threads interfere. > > So, MPS puts a read barrier on P (say with mprotect), so that other > threads are interrupted by a signal when they read from P. MPS puts a > write barrier on P so that the same happens when a thread tries to > modifiy P. > > Does that help? I understand how this is supposed to work, and I even see in MPS the Windows code to implement this (protw3.c). My problem is that I don't see any evidence for these exceptions under GDB. GDB has 2 Windows-specific settings to show debug information about exceptions and debug-related events: "set debugexceptions" and "set debugevents". I turned both ON, but all I see is kernel events for creation and exiting of threads. Nothing more, and no exception events anywhere in sight. So I'm confused.