Changeset 230360 in webkit
- Timestamp:
- Apr 6, 2018 5:00:34 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r230303 r230360 1 2018-04-06 Saam Barati <sbarati@apple.com> 2 3 bmalloc's tryLargeZeroedMemalignVirtual shouldn't treat the entire virtual size as dirty towards its footprint 4 https://bugs.webkit.org/show_bug.cgi?id=184207 5 6 Reviewed by Mark Lam. 7 8 * wtf/Gigacage.cpp: 9 (Gigacage::freeVirtualPages): 10 1 11 2018-04-05 Yusuke Suzuki <utatane.tea@gmail.com> 2 12 -
trunk/Source/WTF/wtf/Gigacage.cpp
r227951 r230360 109 109 } 110 110 111 void freeVirtualPages(Kind kind, void* basePtr, size_t )111 void freeVirtualPages(Kind kind, void* basePtr, size_t size) 112 112 { 113 113 if (!basePtr) 114 114 return; 115 115 RELEASE_ASSERT(isCaged(kind, basePtr)); 116 bmalloc::api::freeLargeVirtual(basePtr, bmalloc::heapKind(kind));116 bmalloc::api::freeLargeVirtual(basePtr, size, bmalloc::heapKind(kind)); 117 117 WTF::compilerFence(); 118 118 } -
trunk/Source/bmalloc/ChangeLog
r230317 r230360 1 2018-04-06 Saam Barati <sbarati@apple.com> 2 3 bmalloc virtual allocation API should not treat memory it vends as dirty with respect to how it drives the scavenger 4 https://bugs.webkit.org/show_bug.cgi?id=184342 5 6 Reviewed by Mark Lam. 7 8 Currently, the only user of this API is Wasm. Ideally, Wasm would tell 9 us exactly which page is dirtied. We should really do that at some point: 10 https://bugs.webkit.org/show_bug.cgi?id=184207 11 12 However, until we do that, it's better to treat none of the virtual memory 13 we vend as dirty, versus what we do now, which is treat it all as dirty. 14 This dirty memory tracking helps drive the scavenger, so on iOS, having the 15 scavenger think its under memory pressure because of memory it can't free isn't 16 useful. 17 18 * bmalloc/bmalloc.cpp: 19 (bmalloc::api::tryLargeZeroedMemalignVirtual): 20 (bmalloc::api::freeLargeVirtual): 21 * bmalloc/bmalloc.h: 22 1 23 2018-04-05 Saam Barati <sbarati@apple.com> 2 24 -
trunk/Source/bmalloc/bmalloc/bmalloc.cpp
r230308 r230360 55 55 std::lock_guard<Mutex> lock(Heap::mutex()); 56 56 result = heap.tryAllocateLarge(lock, alignment, size); 57 if (result) { 58 // Don't track this as dirty memory that dictates how we drive the scavenger. 59 // FIXME: We should make it so that users of this API inform bmalloc which 60 // pages they dirty: 61 // https://bugs.webkit.org/show_bug.cgi?id=184207 62 heap.externalDecommit(lock, result, size); 63 } 57 64 } 58 65 … … 62 69 } 63 70 64 void freeLargeVirtual(void* object, HeapKind kind)71 void freeLargeVirtual(void* object, size_t size, HeapKind kind) 65 72 { 66 73 kind = mapToActiveHeapKind(kind); 67 74 Heap& heap = PerProcess<PerHeapKind<Heap>>::get()->at(kind); 68 75 std::lock_guard<Mutex> lock(Heap::mutex()); 76 // Balance out the externalDecommit when we allocated the zeroed virtual memory. 77 heap.externalCommit(lock, object, size); 69 78 heap.deallocateLarge(lock, object); 70 79 } -
trunk/Source/bmalloc/bmalloc/bmalloc.h
r230308 r230360 83 83 BEXPORT void freeOutOfLine(void* object, HeapKind kind = HeapKind::Primary); 84 84 85 BEXPORT void freeLargeVirtual(void* object, HeapKind kind = HeapKind::Primary);85 BEXPORT void freeLargeVirtual(void* object, size_t, HeapKind kind = HeapKind::Primary); 86 86 87 87 inline void scavengeThisThread()
Note: See TracChangeset
for help on using the changeset viewer.