From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: Please check if scratch/igc builds with native compilation Date: Wed, 22 May 2024 08:07:15 +0200 Message-ID: References: <87r0du5rly.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20219"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Andrea Corallo , Emacs Devel , Eli Zaretskii To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 22 08:07:43 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 1s9f8Z-00055G-E4 for ged-emacs-devel@m.gmane-mx.org; Wed, 22 May 2024 08:07:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9f8L-0001hp-VA; Wed, 22 May 2024 02:07:30 -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 1s9f8D-0001dr-RU for emacs-devel@gnu.org; Wed, 22 May 2024 02:07:23 -0400 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9f8B-00031A-Sa; Wed, 22 May 2024 02:07:21 -0400 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-572e48f91e9so10731959a12.0; Tue, 21 May 2024 23:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716358037; x=1716962837; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=w4ereSYzhsF/VB6X3oF+XCzi+lr0p1R338Y4MDToIyQ=; b=Gov5cu5Heh1t5xUe1a4V9c5QXIeQ2ptUG4zfyLZSUV6LbH4pGqR5V9DYBtxKm1c7tk L3dW7RjwrX0USuvvAggCuRK660TX1C5/a+ytifrQAH2aBNn2VH+GDPxibo+Ic1eb1T2l P3ekB8fMntKNtGix2rbZVX1u6f3oNIdmg6mrBiSb6treR1SJvU1EHieTtp7PQJEEJWiN fEKKkXDlyGxRX7nw45Xez+tpHUSPYWQRyZhCg/uLLUlfZWAFy86wsJ9zbJdatwDzRNgL m+JahomSXXx+PpW1NvwZJYivo09uRartan+a+HjeYYhUFUnq65zARKtIUyoNVR7VBjmQ 46wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716358037; x=1716962837; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=w4ereSYzhsF/VB6X3oF+XCzi+lr0p1R338Y4MDToIyQ=; b=W8Wq1I6qBEVI2cRTZCkp3uwglEWn+i2x6tRKIu9LI6hdv38uLOxHF9XZKbffVZ9r12 rQ+3phNl3r9ek4WC8k9iWF6JU3rtGPfQ6wTFxI9IAkqfEfakDR3yTdQR7zVq808xczFt v1y+WXPcTXZ59PN63FcdzuoJYEo07SZ6kbm9VqaagbCXKOlGk2REM5hQym2YhvnvRAlo 1Go8/dLiZL4F+r9faq1QErghzz5eWJP/7BBSdwjaLGr29AZmvzn4uHT+SSL9iumRES8p ztbTlzoNGcA0QpX0ZsFVkvOauHWLvXuqKvx/+tdweJsPAAIwMqdHJ8I213a4esOKIvUj qD+w== X-Forwarded-Encrypted: i=1; AJvYcCWe6fztfngMRLPLlUZ5lRGgUgdMpZe0Os8Z01jr7ZSRhoC/Qr+ej0DHWqZ1dOO6UzMlrLtRtfiR5nkJW/d3FkdO5ertucg0m/hAiZ2XGVdH5wY= X-Gm-Message-State: AOJu0YyPXObazYhnGQmb7/F8sS/UO9wrdMgNq04nx9MDWR71WlrWgur9 OM9INof5k55EdbStmf+ah2da9e+ARpeVNHuz27tLga16ED/XaQOE+k/gSQ== X-Google-Smtp-Source: AGHT+IE3r6OK6bx7Ymks35hEW0Qja7xmPCpgVtus3iIxgGWoihETXDnJo7aEshFXJCVUDltdH9m04w== X-Received: by 2002:a17:906:4941:b0:a59:c28a:7eb4 with SMTP id a640c23a62f3a-a62280d4f1dmr52627266b.44.1716358036440; Tue, 21 May 2024 23:07:16 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a357.dip0.t-ipconnect.de. [79.227.163.87]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b01932sm1713828366b.168.2024.05.21.23.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 23:07:16 -0700 (PDT) In-Reply-To: <87r0du5rly.fsf@gmail.com> (Helmut Eller's message of "Wed, 22 May 2024 07:43:21 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x532.google.com 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, SPF_HELO_NONE=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.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:319473 Archived-At: Helmut Eller writes: >> I've checked that d_reloc is indeed scanned by fix_comp_unit. The >> check gives me reasonable confidence that this "should work". But as >> an alternative, I also made all the things like d_reloc in the .elns >> ambiguous roots, so that they cannot possibly be moved, if all works as >> expected. > > Registering the dump as root happens rather late. The relocation code > allocates a hash table and stores a reference to it in > comp_u->lambda_gc_guard_h. By that time the dump should already be a > root. Can we register the dump earlier? AFAIU, the dumper writes zeros > in the cells for to-be-relocated references and the scan code will > ignore them. So I think this could work: > > diff --git a/src/pdumper.c b/src/pdumper.c > index b039e375c1f..39484a16c95 100644 > --- a/src/pdumper.c > +++ b/src/pdumper.c > @@ -5958,6 +5958,7 @@ pdumper_load (const char *dump_filename, char *argv0) > & ~(DUMP_ALIGNMENT - 1)); > void *hot_start = (void *) (dump_base + aligned_header_size); > void *hot_end = (void *) (dump_base + header->discardable_start); > + igc_on_pdump_loaded (hot_start, hot_end); > #endif AFAIU, at the point above the necessary relocations haven't yet been done, so the dump is still in its "raw" form as it is in the file. Which means, among other things, that Lisp_Objects haven't been changed to point to where the dump is mmap'd or where the data segment of Emacs is and so on. So I don't think that would work. > dump_do_all_dump_reloc_for_phase (header, dump_base, EARLY_RELOCS); > @@ -6002,10 +6003,6 @@ pdumper_load (const char *dump_filename, char *argv0) > dump_private.load_time = timespectod (load_timespec); > dump_private.dump_filename = dump_filename_copy; > > -# ifdef HAVE_MPS > - igc_on_pdump_loaded (hot_start, hot_end); > -# endif > - > out: > for (int i = 0; i < ARRAYELTS (sections); ++i) > dump_mmap_release (§ions[i]); But, what if we park MPS while we are loading the dump? WDYT?