[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <enqsr7otef2osf5kmxwlf56y2jegiggiusbzklqxmkd4puk3rq@tarta.nabijaczleweli.xyz>
Date: Fri, 29 Nov 2024 08:17:05 +0100
From: наб <nabijaczleweli@...ijaczleweli.xyz>
To: Rui Ueyama <rui314@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: Wislist for Linux from the mold linker's POV
Hi! one quick q to clarify, if you don't mind.
On Thu, Nov 28, 2024 at 11:52:35AM +0900, Rui Ueyama wrote:
> - exit(2) takes a few hundred milliseconds for a large process
>
> I believe this is because mold mmaps all input files and an output
> file, and clearing/flushing memory-mapped data is fairly expensive.
>
> To avoid this overhead, mold currently forks a child process, lets the
> child handle the actual linking task, and then, as soon as the child
> closes the output file, the parent exits (which takes no time since
> the parent is lightweight). Since the child is not an interactive
> process, it can afford to take its time for exit. While this works, I
> would prefer to avoid it if possible, as it is somewhat a hacky
> workaround.
Sooo am I reading it right that the output file is not valid when mold exits,
since you seem to be exiting /during/ exit->munmap->msync,
while the contents of the file are undefined,
so mold -o whatever && ./whatever is not valid
(while mold -o whatever then ./whatever later is)?
Thanks,
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists