From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E9D333858409 for ; Mon, 13 Dec 2021 13:26:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9D333858409 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-HsfphhhmOsinyBiHGpQujA-1; Mon, 13 Dec 2021 08:26:27 -0500 X-MC-Unique: HsfphhhmOsinyBiHGpQujA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C47B801962; Mon, 13 Dec 2021 13:26:26 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.17.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11308100164A; Mon, 13 Dec 2021 13:26:23 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Szabolcs Nagy , Rongwei Wang , GNU C Library , Adhemerval Zanella , xuyu@linux.alibaba.com, gavin.dg@linux.alibaba.com Subject: Re: [PATCH v6 1/2] elf: Properly align PT_LOAD segments [BZ #28676] References: <20211204045848.71105-1-rongwei.wang@linux.alibaba.com> <20211213025103.48472-1-rongwei.wang@linux.alibaba.com> <20211213025103.48472-2-rongwei.wang@linux.alibaba.com> <20211213110522.GT3294453@arm.com> <87sfuw21qi.fsf@oldenburg.str.redhat.com> <20211213113554.GU3294453@arm.com> <87bl1k1zrg.fsf@oldenburg.str.redhat.com> Date: Mon, 13 Dec 2021 14:26:20 +0100 In-Reply-To: (H. J. Lu's message of "Mon, 13 Dec 2021 05:20:07 -0800") Message-ID: <87ee6gzldv.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2021 13:26:31 -0000 * H. J. Lu: > On Mon, Dec 13, 2021 at 3:59 AM Florian Weimer wrote= : >> >> * Szabolcs Nagy: >> >> >> What are the p_align values of the involved objects? I would not exp= ect >> >> any changes on 32-bit Arm because p_align and the run-time page size >> >> should match there. >> > >> > p_align is 64K >> > >> > and i see a lot of close to 64K PROT_NONE mappings >> > left behind after many dlclose which creates a lot of >> > vm fragmentation when dlopen/dlclose is called in a loop. >> > >> > (i think the mapping is at the beginning or end of >> > the lib as some kind of padding and left behind after >> > dlclose, but haven't confirmed this yet) >> >> Oh. So why there is a real bug here, I think we need to discuss what >> the change means for 64K p_align binaries on 4K kernels. Do the >> additional munmap calls matter for startup performance? > > We should align munmap arguments. Sorry, I meant =E2=80=9Cwhile there is a real bug here=E2=80=9D, that is: e= ven if we fix that, the additional munmap calls could hurt startup performance. >> (I understand this is very much a correctness fix, but startup >> performance matters as well.) >> > > The kernel loader doesn't call munmap in this case. Should > we be concerned about the unused pages? Which approach leads to fewer mappings that count against the map limit (64K by default I believe)? Thanks, Florian