Changeset 221548 in webkit
- Timestamp:
- Sep 3, 2017 3:31:29 AM (7 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r221422 r221548 1 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Large virtual memory region allocation requires MMAP_NORESERVE in Linux 4 https://bugs.webkit.org/show_bug.cgi?id=176211 5 6 Reviewed by Geoffrey Garen. 7 8 In Linux, we cannot allocate very large memory region without MMAP_NORESERVE. 9 Linux kernel needs to reserve swap area for allocated memory region. If the 10 swap area is exhausted, kernel fails to allocate the memory region with ENOMEM. 11 12 This patch adds MMAP_NORESERVE to mmap flags in Linux. By adding this flag, 13 mmap does not need to reserve swap area for the reserved memory region. 14 This allows us to reserve very large memory region that is necessary for Gigacage. 15 16 * bmalloc/BPlatform.h: 17 * bmalloc/VMAllocate.h: 18 (bmalloc::tryVMAllocate): 19 1 20 2017-08-22 Filip Pizlo <fpizlo@apple.com> 2 21 -
trunk/Source/bmalloc/bmalloc/BPlatform.h
r221213 r221548 43 43 #endif 44 44 45 #ifdef __linux__ 46 #define BOS_LINUX 1 47 #endif 48 45 49 #if defined(WIN32) || defined(_WIN32) 46 50 #define BOS_WINDOWS 1 -
trunk/Source/bmalloc/bmalloc/VMAllocate.h
r219055 r221548 45 45 #if BOS(DARWIN) 46 46 #define BMALLOC_VM_TAG VM_MAKE_TAG(VM_MEMORY_TCMALLOC) 47 #else 47 #define BMALLOC_NORESERVE 0 48 #elif BOS(LINUX) 48 49 #define BMALLOC_VM_TAG -1 50 #define BMALLOC_NORESERVE MAP_NORESERVE 51 #else 52 #define BMALLOC_VM_TAG -1 53 #define BMALLOC_NORESERVE 0 49 54 #endif 50 55 … … 117 122 { 118 123 vmValidate(vmSize); 119 void* result = mmap(0, vmSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON , BMALLOC_VM_TAG, 0);124 void* result = mmap(0, vmSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | BMALLOC_NORESERVE, BMALLOC_VM_TAG, 0); 120 125 if (result == MAP_FAILED) { 121 126 logVMFailure();
Note: See TracChangeset
for help on using the changeset viewer.