d516115a24
Android and various applications in Android need to read PID map data in order to work. Some processes can contain over 10,000 mappings, which results in lots of time wasted on simply generating strings. This wasted time adds up, especially in the case of Unity-based games, which utilize the Boehm garbage collector. A game's main process typically has well over 10,000 mappings due to the loaded textures, and the Boehm GC reads PID maps several times a second. This results in over 100,000 map entries being printed out per second, so micro-optimization here is important. Before this commit, show_vma_header_prefix() would typically take around 1000 ns to run on a Snapdragon 855; now it only takes about 50 ns to run, which is a 20x improvement. The primary micro-optimizations here assume that there are no more than 40 bits in the virtual address space, hence the CONFIG_ARM64_VA_BITS check. Arm64 uses a virtual address size of 39 bits, so this perfectly covers it. This also removes padding used to beautify PID map output to further speed up reads and reduce the amount of bytes printed, and optimizes the dentry path retrieval for file-backed mappings. Note, however, that the trailing space at the end of the line for non-file-backed mappings cannot be omitted, as it breaks some PID map parsers. This still retains insignificant leading zeros from printed hex values to maintain the current output format. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: LibXZR <xzr467706992@163.com> |
||
---|---|---|
android | ||
arch | ||
block | ||
certs | ||
crypto | ||
Documentation | ||
drivers | ||
firmware | ||
fs | ||
include | ||
init | ||
ipc | ||
kernel | ||
lib | ||
LICENSES | ||
mm | ||
net | ||
samples | ||
scripts | ||
security | ||
sound | ||
techpack | ||
tools | ||
usr | ||
virt | ||
.clang-format | ||
.cocciconfig | ||
.get_maintainer.ignore | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
AndroidKernel.mk | ||
build.config.aarch64 | ||
build.config.allmodconfig | ||
build.config.allmodconfig.aarch64 | ||
build.config.allmodconfig.arm | ||
build.config.allmodconfig.x86_64 | ||
build.config.arm | ||
build.config.common | ||
build.config.gki | ||
build.config.gki_kasan | ||
build.config.gki_kasan.aarch64 | ||
build.config.gki_kasan.x86_64 | ||
build.config.gki_kprobes | ||
build.config.gki_kprobes.aarch64 | ||
build.config.gki_kprobes.x86_64 | ||
build.config.gki-debug.aarch64 | ||
build.config.gki-debug.x86_64 | ||
build.config.gki.aarch64 | ||
build.config.gki.x86_64 | ||
build.config.goldfish.arm | ||
build.config.goldfish.arm64 | ||
build.config.goldfish.mips | ||
build.config.goldfish.mips64 | ||
build.config.goldfish.x86 | ||
build.config.goldfish.x86_64 | ||
build.config.x86_64 | ||
COPYING | ||
CREDITS | ||
gen_headers_arm64.bp | ||
gen_headers_arm.bp | ||
Kbuild | ||
Kconfig | ||
kernel_headers.py | ||
MAINTAINERS | ||
Makefile | ||
OWNERS | ||
README | ||
verity_dev_keys.x509 |
Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first. In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``. The formatted documentation can also be read online at: https://www.kernel.org/doc/html/latest/ There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation. See Documentation/00-INDEX for a list of what is contained in each file. Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.