From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500b.mail.yandex.net (forward500b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d500]) by sourceware.org (Postfix) with ESMTPS id EEAEB3858CDA for ; Thu, 30 Mar 2023 08:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEAEB3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bdac:0:640:e97d:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 330865F381; Thu, 30 Mar 2023 11:09:51 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id n9Egb9CDUSw0-OWA0V2W8; Thu, 30 Mar 2023 11:09:50 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1680163790; bh=hVISlayOVzxB8bCzw2M/XKmIdAIB1dZ99tnvWX+Z1xU=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=loXWoJELYtbIchCX8INd+TmRA2lSF1/9o4MTAxsY8SihvOcNb4HouPbdHrM3NwXVV 2ufdHgyf2Ym4Xa/TiTqNUMPGaC5CaiZdnyWK6f/P6UqGk2Kqo3IerHv2kBwFs8kfjh RpJK1uGcgmVkWCv0ceGE7uEtZ6XKT/KdhGL1x0ac= Authentication-Results: mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <93a6b6d3-66c5-b809-3798-9c73efc1ada1@yandex.ru> Date: Thu, 30 Mar 2023 13:09:48 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 12/13] dlfcn,elf: implement dlmem() [BZ #11767] Content-Language: en-US To: Jonathon Anderson , Carlos O'Donell , libc-alpha@sourceware.org References: <20230318165110.3672749-1-stsp2@yandex.ru> <20230318165110.3672749-13-stsp2@yandex.ru> <3541bbd7-8a68-2064-bb63-2a921cfe3bb1@yandex.ru> <630fa17528c6050d60f524aa88ad5a057cae1603.camel@rice.edu> From: stsp In-Reply-To: <630fa17528c6050d60f524aa88ad5a057cae1603.camel@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 29.03.2023 19:10, Jonathon Anderson пишет: > The second glaring issue (from my perspective) is that you are mmapping the entire file, instead of just the executable code. I have personally compiled up binaries where the DWARF debugging information was far larger than the code, one extreme case was a ~7.7GB binary of which merely ~130MB was .text. It is critical for performance that only that ~130MB is loaded from disk in the nominal case. I assure you that only the PT_LOAD sections will be read from disk. mmap() is not read(), it doesn't prefetch the mapped pages. I however admit (and may need to document) that some absurdly large solibs, like 4Gb on a 32bit system, may represent a problem. Another thing I need to admit, is that I can't implement dlopen_with_offset() very efficiently for the very same reason: it loads the solib from a container file that may be absurdly large. So I'll demo-implement dlopen_with_offset2() that has an extra "length" argument to specify the solib length in a container file.