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 codegen Date: Sat, 15 Jun 2024 09:11:03 +0300 Message-ID: <86plsiwxag.fsf@gnu.org> References: <87le3b43qi.fsf@gmail.com> <86r0d21tqj.fsf@gnu.org> <877cetgqiz.fsf_-_@gmail.com> <87wmmsg2e4.fsf@gmail.com> <878qz8ezn4.fsf@gmail.com> <8734pfgb51.fsf@gmail.com> <86ikybyd2h.fsf@gnu.org> <87v82bebc6.fsf@gmail.com> <86wmmrwf86.fsf@gnu.org> <86r0czwdmc.fsf@gnu.org> <87jzire36a.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20014"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, acorallo@gnu.org, emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 15 08:12:00 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 1sIMds-00050d-JE for ged-emacs-devel@m.gmane-mx.org; Sat, 15 Jun 2024 08:12:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIMd0-0000P1-B4; Sat, 15 Jun 2024 02:11:06 -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 1sIMcz-0000Or-GC for emacs-devel@gnu.org; Sat, 15 Jun 2024 02:11:05 -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 1sIMcy-00064V-Uk; Sat, 15 Jun 2024 02:11:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9bJgEZfCspRffqcXAD0x560J47m8CdfOKBI9ZAfYGpk=; b=rZtAJTNPFbLx KL8+sT52wZ/HjbH8Zm9eJflSPgZaGPVJweWkjJm/XKXrSXErCZ/LvLy/t2WxxfMDyWuW+JfKZ8iTP 2Q9dyBd9ULD7bOR8KQ05QNDO1O3cJI9OJebwmgVYuHiV54wfVfm54FBU3yCmo3bgEJ+YbDLE10ehX S8TJpN4HCHRxR7cMVXL0dxdI7z5WRbXJAzPzQO+AMycUbmZjVtDzrFQ405OfD7Jt+JiNIm5w7AUpC cdp5zt37KnZq/UvxA5q6Imj6EVxQQ2Ra76QcaJo/7axx6sBU3oYcARdJqs93jnEh2sROxtfQDGE1/ K6xg7LzeJg3/fC6Y5qFJ9g==; In-Reply-To: <87jzire36a.fsf@gmail.com> (message from Helmut Eller on Fri, 14 Jun 2024 21:26:37 +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:320098 Archived-At: > From: Helmut Eller > Cc: gerd.moellmann@gmail.com, acorallo@gnu.org, emacs-devel@gnu.org > Date: Fri, 14 Jun 2024 21:26:37 +0200 > > On Fri, Jun 14 2024, Eli Zaretskii wrote: > > > More generally, what exactly has been changed wrt loading from the > > pdumper file since commit 219f7d5? > > The file is first loaded (mostly) as before; then all objects from the > hot section are copied to a MPS managed region. Finally the hot section > is discarded. Can't we instead tell MPS not to move or manage any objects loaded from the pdumper file? That's basically what we do now on master: any object loaded from the pdumper file is considered immutable. > My hypothesis is that discard_dump is the problem. The hot section > probably contains something that isn't properly copied and > dump_discard_mem seems to be a bit different on Windows. Why it even > works on Linux is a mystery to me :-). The Windows code decommits the memory region and makes it inaccessible. By contrast, the posix_madvise method is AFAIU just an advisory, and doesn't necessarily make the memory inaccessible. Moreover, the Linux man page says: In glibc, this function is implemented using madvise(2). However, since glibc 2.6, POSIX_MADV_DONTNEED is treated as a no- op, because the corresponding madvise(2) value, MADV_DONTNEED, has destructive semantics. So to do on Posix systems the same as we do on Windows, I think we need to call madvise with MADV_DONTNEED, even if posix_madvise is available, and also call mmap with PROT_NONE. Do you agree? If we do that, does the GNU/Linux build still work, or does it also crash on startup?