From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 11606 invoked from network); 18 Mar 2000 01:08:56 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 18 Mar 2000 01:08:56 -0000 Received: from piglet.twiddle.net (piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id UAA19018 for ; Fri, 17 Mar 2000 20:08:55 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.9.3/8.9.3) id RAA04743 for axp-list@redhat.com; Fri, 17 Mar 2000 17:08:51 -0800 Date: Fri, 17 Mar 2000 17:08:51 -0800 From: Richard Henderson To: axp-list@redhat.com Subject: Re: /proc//maps Message-ID: <20000317170851.A4725@twiddle.net> References: <412568A5.00832BF4.00@saturn.aladdin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us In-Reply-To: <412568A5.00832BF4.00@saturn.aladdin.de> On Sat, Mar 18, 2000 at 12:48:21AM +0100, cpg@aladdin.de wrote: > If I look at /proc//maps I've got 3 entries for every shared lib > the process uses. On i386 there are only 2 entries for each shlib [...] > What is the purpose of this mapping and where does it come from? This is an artifact of the glibc ld.so. It will appear on any architecture that has a maximum architectural page size larger than the current os page size. What happens is that glibc reserves the entire memory region that it needs with PROT_NONE. We do this because all segments must have a fixed relationship with one another, so we have mmap bring us the first unused contiguous region that's large enough. We then goes back and remap the actual Phdr entries with proper permissions and MAP_FIXED. If, for the reason mentioned above, the linker has "overaligned" the data segment, then there may be unused space between the text and data segment. We could of course unmap that region, but there's not really any point. On no system that I am aware of will it be larger than 16 pages, which means that the PMD is already in use, which means that we're not really consuming any extra page table resources. The lack of foresight in not defining a large maximum architectural page size for x86 is actually hurting ia64 folks who want to do emulation. Ideally they'd like to have a 16K system page size, but all the x86 binaries are linked expecting a 4K page size. Which can be worked around with effort, but it shouldn't have been necessary. r~