Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b651d820ecaab692e24ee2b2f2b915e8a04908cf
https://github.com/WebKit/WebKit/commit/b651d820ecaab692e24ee2b2f2b915e8a04908cf
Author: Yusuke Suzuki <[email protected]>
Date: 2026-04-07 (Tue, 07 Apr 2026)
Changed paths:
M Source/WTF/wtf/OSAllocator.h
M Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp
M Source/bmalloc/bmalloc/BVMTags.h
M Source/bmalloc/bmalloc/Gigacage.cpp
M Source/bmalloc/bmalloc/VMAllocate.h
M Source/bmalloc/libpas/src/libpas/pas_page_malloc.c
Log Message:
-----------
[JSC] Tag allocated memory with name on Linux too
https://bugs.webkit.org/show_bug.cgi?id=311606
rdar://174202713
Reviewed by Justin Michaud.
Using `prctl` system call when allocating pages. This allows Linux to
tag pages with names like what Darwin VMTag is doing. smaps can have
these names for debugging.
We also uses MADV_DONTNEED for page-based zero-clearing on Linux. mmap
with MAP_FIXED will create a new VMA which clears an attached name & VMA.
madvise + MADV_DONTNEED offers page-based zero-clearing while keeping VMA.
```
7cd00514a000-7cd005170000 rw-p 00000000 00:00 0
[anon:JSGigacage]
Size: 152 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Rss: 152 kB
Pss: 152 kB
Pss_Dirty: 152 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 152 kB
Referenced: 152 kB
Anonymous: 152 kB
KSM: 0 kB
LazyFree: 0 kB
AnonHugePages: 0 kB
ShmemPmdMapped: 0 kB
FilePmdMapped: 0 kB
Shared_Hugetlb: 0 kB
Private_Hugetlb: 0 kB
Swap: 0 kB
SwapPss: 0 kB
Locked: 0 kB
THPeligible: 0
VmFlags: rd wr mr mw me nr sd
```
* Source/WTF/wtf/OSAllocator.h:
* Source/WTF/wtf/posix/OSAllocatorPOSIX.cpp:
(WTF::OSAllocator::tryReserveAndCommit):
(WTF::OSAllocator::tryReserveAndCommitImpl):
(WTF::OSAllocator::tryReserveUncommitted):
(WTF::OSAllocator::zeroFill):
* Source/bmalloc/bmalloc/BVMTags.h:
(bmalloc::vmTagName):
(bmalloc::vmTagFd):
* Source/bmalloc/bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):
* Source/bmalloc/bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate):
(bmalloc::vmZeroAndPurge):
* Source/bmalloc/libpas/src/libpas/pas_page_malloc.c:
(pas_page_malloc_try_map_pages):
(pas_page_malloc_zero_fill):
Canonical link: https://commits.webkit.org/310721@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications