WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Updated Patch with bug reference in ChangeLog
63015-3.patch (text/plain), 4.78 KB, created by
Michael Saboff
on 2011-06-20 17:01:28 PDT
(
hide
)
Description:
Updated Patch with bug reference in ChangeLog
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2011-06-20 17:01:28 PDT
Size:
4.78 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 89291) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2011-06-20 Michael Saboff <msaboff@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ releaseFastMallocFreeMemory doesn't adjust free counts for scavenger >+ https://bugs.webkit.org/show_bug.cgi?id=63015 >+ >+ Added code to adjust class TCMalloc_PageHeap variables free_committed_pages_ and >+ min_free_committed_pages_since_last_scavenge_ in ReleaseFreeList(). Made >+ ReleaseFreeList a member of TCMalloc_PageHeap in the process. Updated >+ Check() and helper method CheckList() to check the number of actual free pages >+ with free_committed_pages_. >+ >+ Note that the style of the changes was kept consistent with the >+ existing style. >+ >+ * wtf/FastMalloc.cpp: >+ (WTF::TCMalloc_PageHeap::Check): >+ (WTF::TCMalloc_PageHeap::CheckList): >+ (WTF::TCMalloc_PageHeap::ReleaseFreeList): >+ > 2011-06-18 Anders Carlsson <andersca@apple.com> > > Reviewed by Darin Adler. >Index: Source/JavaScriptCore/wtf/FastMalloc.cpp >=================================================================== >--- Source/JavaScriptCore/wtf/FastMalloc.cpp (revision 89213) >+++ Source/JavaScriptCore/wtf/FastMalloc.cpp (working copy) >@@ -1357,10 +1357,11 @@ class TCMalloc_PageHeap { > } > > bool Check(); >- bool CheckList(Span* list, Length min_pages, Length max_pages, bool decommitted); >+ size_t CheckList(Span* list, Length min_pages, Length max_pages, bool decommitted); > > // Release all pages on the free list for reuse by the OS: > void ReleaseFreePages(); >+ void ReleaseFreeList(Span*, Span*); > > // Return 0 if we have no information, or else the correct sizeclass for p. > // Reads and writes to pagemap_cache_ do not require locking. >@@ -2117,23 +2118,38 @@ bool TCMalloc_PageHeap::GrowHeap(Length > } > > bool TCMalloc_PageHeap::Check() { >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ size_t totalFreeCommitted = 0; >+#endif > ASSERT(free_[0].normal.next == &free_[0].normal); > ASSERT(free_[0].returned.next == &free_[0].returned); >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ totalFreeCommitted = CheckList(&large_.normal, kMaxPages, 1000000000, false); >+#else > CheckList(&large_.normal, kMaxPages, 1000000000, false); >- CheckList(&large_.returned, kMaxPages, 1000000000, true); >+#endif >+ CheckList(&large_.returned, kMaxPages, 1000000000, true); > for (Length s = 1; s < kMaxPages; s++) { >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ totalFreeCommitted += CheckList(&free_[s].normal, s, s, false); >+#else > CheckList(&free_[s].normal, s, s, false); >+#endif > CheckList(&free_[s].returned, s, s, true); > } >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ ASSERT(totalFreeCommitted == free_committed_pages_); >+#endif > return true; > } > > #if ASSERT_DISABLED >-bool TCMalloc_PageHeap::CheckList(Span*, Length, Length, bool) { >+size_t TCMalloc_PageHeap::CheckList(Span*, Length, Length, bool) { > return true; > } > #else >-bool TCMalloc_PageHeap::CheckList(Span* list, Length min_pages, Length max_pages, bool decommitted) { >+size_t TCMalloc_PageHeap::CheckList(Span* list, Length min_pages, Length max_pages, bool decommitted) { >+ size_t freeCount = 0; > for (Span* s = list->next; s != list; s = s->next) { > CHECK_CONDITION(s->free); > CHECK_CONDITION(s->length >= min_pages); >@@ -2141,22 +2157,37 @@ bool TCMalloc_PageHeap::CheckList(Span* > CHECK_CONDITION(GetDescriptor(s->start) == s); > CHECK_CONDITION(GetDescriptor(s->start+s->length-1) == s); > CHECK_CONDITION(s->decommitted == decommitted); >+ freeCount += s->length; > } >- return true; >+ return freeCount; > } > #endif > >-static void ReleaseFreeList(Span* list, Span* returned) { >+void TCMalloc_PageHeap::ReleaseFreeList(Span* list, Span* returned) { > // Walk backwards through list so that when we push these > // spans on the "returned" list, we preserve the order. >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ size_t freePageReduction = 0; >+#endif >+ > while (!DLL_IsEmpty(list)) { > Span* s = list->prev; >+ > DLL_Remove(s); > s->decommitted = true; > DLL_Prepend(returned, s); > TCMalloc_SystemRelease(reinterpret_cast<void*>(s->start << kPageShift), > static_cast<size_t>(s->length << kPageShift)); >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ freePageReduction += s->length; >+#endif > } >+ >+#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY >+ free_committed_pages_ -= freePageReduction; >+ if (free_committed_pages_ < min_free_committed_pages_since_last_scavenge_) >+ min_free_committed_pages_since_last_scavenge_ = free_committed_pages_; >+#endif > } > > void TCMalloc_PageHeap::ReleaseFreePages() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 63015
:
97867
|
97871
|
97890
|
97932