From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 081E63858415; Tue, 28 Nov 2023 23:58:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 081E63858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701215935; bh=/7qvOEYRzUUCRoczhfeHAz38mcZGcAcVzXMt3nq2mGY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ajTlkkTCqUEn7Gcr0KPx9WovfTe7iyPL7PBFZMi3lyCqD6giDOgHfbbQJ2TuIUK/u jMAqYDq87ZnyiHAbUD/MWd5P848gwU0GOm9IKj1O9SBbC202s50OJC5/jDfF0bA4PB rZ07CuzszGMiiXBoazwtYoihdVjYlORtrg2iNWRs= From: "jyescas at google dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31076] Extra struct vm_area_struct with ---p created when PAGE_SIZE < max-page-size Date: Tue, 28 Nov 2023 23:58:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jyescas at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31076 --- Comment #16 from Juan Yescas --- (In reply to Ryan Prichard from comment #14) > > When we compile all the shared libraries in the system with -Wl,-z,max-= page-size=3D65536 and use 4k page size kernel, for every PT_LOAD segment (e= xcept the last) loaded in memory, there will be a vm_area_struct with ---p = permissions. >=20 > > In mobile devices we have seen an increased of 120K vm_area_structs due= -Wl,-z,max-page-size=3D65536. There used to be 40K vm_area_structs. This i= s an increase of ~18MB (120K * 152). >=20 > I would've expected the number of VMAs to nearly double, but it sounds li= ke > they quadrupled instead? Sorry for the confusion, I was comparing different devices. These are results where we can see the increase in extra vmas when the alignment is max-page-size=3D65536. VMA size =3D 200 Loaded ELF segments =3D 181806 PROT_NONE (---p) gaps =3D 124297 <- This is the # of extra vmas Slab Memory ELF Usage: 34 MB Slab Memory noneprot Usage: 23 MB The script that was used is below: ``` #!/bin/sh vma_size=3D$(cat /proc/slabinfo | grep vm_area_struct | awk '{ print $4 }') echo "VMA size =3D $vma_size" nr_elf_segs=3D$(cat /proc/*/maps | grep '\.so' | wc -l) echo "Loaded ELF segments =3D $nr_elf_segs" nr_noneprot=3D$(cat /proc/*/maps | grep -A1 '\.so' | grep '\---p' | wc -l) echo "PROT_NONE (---p) gaps =3D $nr_noneprot" slab_mem_mb=3D$(echo "$vma_size * $nr_elf_segs / 1024 / 1024" | bc) echo "Slab Memory ELF Usage: $slab_mem_mb MB" slab_mem_mb=3D$(echo "$vma_size * $nr_noneprot / 1024 / 1024" | bc) echo "Slab Memory PROTNONE GAP Usage: $slab_mem_mb MB" ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=