5134762efa
These are padding pages are only needed to layout the ELF to be compatible with max-page-size. They are zero-filled (holes) and can be dropped from the page cache. The madvise() here is a special case that also serves to hint to the kernel what part of the segment is padding. For example the kernel then shows these padding regions as PROT_NONE VMAs (labeled [page size compat]) in /proc/*/maps. Note: This doesn't use backing vm_area_structs, so doesn't consume additional slab memory. Before: ❯ cf-adb shell cat /proc/1/maps | grep -A1 'libbase.so$' 7f8d13600000-7f8d13614000 r--p 00000000 fe:09 21909460 /system/lib64/libbase.so 7f8d13614000-7f8d13638000 r-xp 00014000 fe:09 21909460 /system/lib64/libbase.so 7f8d13638000-7f8d1363c000 r--p 00038000 fe:09 21909460 /system/lib64/libbase.so 7f8d1363c000-7f8d1363d000 rw-p 0003c000 fe:09 21909460 /system/lib64/libbase.so Segments appear extended in /proc/<pid>/maps After: ❯ cf-adb shell cat /proc/1/maps | grep -A1 'libbase.so$' 7f3650043000-7f3650054000 r--p 00000000 fe:09 21906900 /system/lib64/libbase.so 7f3650054000-7f3650057000 ---p 00000000 00:00 0 [page size compat] 7f3650057000-7f3650079000 r-xp 00014000 fe:09 21906900 /system/lib64/libbase.so 7f3650079000-7f365007b000 ---p 00000000 00:00 0 [page size compat] 7f365007b000-7f365007c000 r--p 00038000 fe:09 21906900 /system/lib64/libbase.so 7f365007c000-7f365007f000 ---p 00000000 00:00 0 [page size compat] 7f365007f000-7f3650080000 rw-p 0003c000 fe:09 21906900 /system/lib64/libbase.so Segments maintain PROT_NONE gaps ("[page size compat]") for app compatiblity but these are not backed by actual slab VMA memory. Bug: 330117029 Bug: 327600007 Bug: 330767927 Bug: 328266487 Bug: 329803029 Test: Manual - Launch Free Fire Chaos app Change-Id: Ic50540e247b4294eb08f8cf70e74bd2bf6606684 Signed-off-by: Kalesh Singh <kaleshsingh@google.com> |
||
---|---|---|
.. | ||
arch | ||
testdata | ||
Android.bp | ||
dlfcn.cpp | ||
ld.config.format.md | ||
ld_android.cpp | ||
ldd.sh | ||
linked_list.h | ||
linked_list_test.cpp | ||
linker.arm.map | ||
linker.cpp | ||
linker.generic.map | ||
linker.h | ||
linker_auxv.cpp | ||
linker_auxv.h | ||
linker_block_allocator.cpp | ||
linker_block_allocator.h | ||
linker_block_allocator_test.cpp | ||
linker_cfi.cpp | ||
linker_cfi.h | ||
linker_common_types.h | ||
linker_config.cpp | ||
linker_config.h | ||
linker_config_test.cpp | ||
linker_crt_pad_segment_test.cpp | ||
linker_debug.cpp | ||
linker_debug.h | ||
linker_debuggerd.h | ||
linker_debuggerd_android.cpp | ||
linker_debuggerd_stub.cpp | ||
linker_dlwarning.cpp | ||
linker_dlwarning.h | ||
linker_gdb_support.cpp | ||
linker_gdb_support.h | ||
linker_globals.cpp | ||
linker_globals.h | ||
linker_gnu_hash.h | ||
linker_gnu_hash_benchmark.cpp | ||
linker_gnu_hash_test.cpp | ||
linker_libc_support.c | ||
linker_libcxx_support.cpp | ||
linker_logger.cpp | ||
linker_logger.h | ||
linker_main.cpp | ||
linker_main.h | ||
linker_mapped_file_fragment.cpp | ||
linker_mapped_file_fragment.h | ||
linker_memory.cpp | ||
linker_namespaces.cpp | ||
linker_namespaces.h | ||
linker_note_gnu_property.cpp | ||
linker_note_gnu_property.h | ||
linker_note_gnu_property_test.cpp | ||
linker_phdr.cpp | ||
linker_phdr.h | ||
linker_reloc_iterators.h | ||
linker_relocate.cpp | ||
linker_relocate.h | ||
linker_relocs.h | ||
linker_sdk_versions.cpp | ||
linker_sleb128.h | ||
linker_sleb128_test.cpp | ||
linker_soinfo.cpp | ||
linker_soinfo.h | ||
linker_test_globals.cpp | ||
linker_tls.cpp | ||
linker_tls.h | ||
linker_translate_path.cpp | ||
linker_translate_path.h | ||
linker_transparent_hugepage_support.cpp | ||
linker_utils.cpp | ||
linker_utils.h | ||
linker_utils_test.cpp | ||
linker_wrapper.cpp | ||
MODULE_LICENSE_BSD | ||
NOTICE | ||
rt.cpp |