[all-commits] [llvm/llvm-project] 2620cc: ANDROID: x86_64: Set default max-page-size to 16kB...

Kalesh Singh via All-commits all-commits at lists.llvm.org
Fri Apr 12 11:43:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2620ccc3cdebcaa53b96b5f4d79ffe3951534e07
      https://github.com/llvm/llvm-project/commit/2620ccc3cdebcaa53b96b5f4d79ffe3951534e07
  Author: Kalesh Singh <kaleshsingh96 at gmail.com>
  Date:   2024-04-12 (Fri, 12 Apr 2024)

  Changed paths:
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/test/Driver/android-link.cpp

  Log Message:
  -----------
  ANDROID: x86_64: Set default max-page-size to 16kB (#87413)

Android now supports both 4kB and 16kB page sizes. The vast majority of
android apps are developed on x86_64 machines. In order to provide
emulators that support larger page sizes, Android emulates the page-size
in x86_64 to support testing apps for large page size support.

For this reason, update Android x86_64 ELFs default max-page-size to
16384 to support both 4kB and 16kB page-size devices.

Increase max-page-size raises concerns of increased disk space and extra
VMA slab memory.

In Android, RO partitions use sparse images, so that the holes on ELFs
don't allocate blocks on disk; and PackageManager ensures to punch holes
in ELF-paddings on the /data partition when apps are installed.

Extra VMA slab memory is addressed by the bionic loader, which extends
segment VMAs to cover the gaps between consecutive segment mappings, to
avoid the extra VMAs needed for the gap PROT_NONE mappings (---p). This
optimization is done in the crt_pad_segment note [1] is present in the
ELF.

[1]
https://cs.android.com/android/platform/superproject/main/+/189e480390ef13199d59e1fb54078e8b78ea6f79:bionic/libc/arch-common/bionic/crt_pad_segment.S

---------

Signed-off-by: Kalesh Singh <kaleshsingh at google.com>
Co-authored-by: Kalesh Singh <kaleshsingh at google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list