WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
86519
Block freeing thread should not free blocks when we are actively requesting them
https://bugs.webkit.org/show_bug.cgi?id=86519
Summary
Block freeing thread should not free blocks when we are actively requesting them
Mark Hahnenberg
Reported
2012-05-15 13:39:44 PDT
The block freeing thread shoots us in the foot if it decides to run while we're actively requesting blocks and returning them. This situation can arise when there is a lot of copying collection going on in steady state. We allocate a large swath of pages to copy into, then we return all the newly free old pages to the BlockAllocator. In this state, if the block freeing thread wakes up in between collections (which is more likely than it waking up during a collection) and frees half of these pages, they will be needed almost immediately during the next collection, causing a storm of VM allocations which we know are going to be very slow. What we'd like is for when things have quieted down the block freeing thread can then return memory to the OS. Usually this will be when a page has fully loaded and has a low allocation rate. In this situation, our opportunistic collections will only be running at least every few seconds, thus the extra time spent doing VM allocations won't matter nearly as much as, say, while a page is loading.
Attachments
Patch
(4.13 KB, patch)
2012-05-15 13:51 PDT
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Benchmark results
(15.47 KB, text/plain)
2012-05-15 15:03 PDT
,
Mark Hahnenberg
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Mark Hahnenberg
Comment 1
2012-05-15 13:51:57 PDT
Created
attachment 142045
[details]
Patch
Geoffrey Garen
Comment 2
2012-05-15 14:13:48 PDT
Comment on
attachment 142045
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=142045&action=review
r=me
> Source/JavaScriptCore/heap/BlockAllocator.h:69 > + m_isCurrentlyAllocating = true; > MutexLocker locker(m_freeBlockLock);
Let's put this assignment inside the lock, to guarantee proper synchronization.
Mark Hahnenberg
Comment 3
2012-05-15 15:03:01 PDT
Created
attachment 142069
[details]
Benchmark results Mostly neutral.
Mark Hahnenberg
Comment 4
2012-05-15 15:49:53 PDT
<
rdar://problem/11458880
>
WebKit Review Bot
Comment 5
2012-05-15 16:37:40 PDT
Comment on
attachment 142045
[details]
Patch Clearing flags on attachment: 142045 Committed
r117183
: <
http://trac.webkit.org/changeset/117183
>
WebKit Review Bot
Comment 6
2012-05-15 16:37:44 PDT
All reviewed patches have been landed. Closing bug.
Mark Hahnenberg
Comment 7
2012-05-15 18:35:47 PDT
Reopening because I wasn't paying attention and committed the version that doesn't lock before setting the flag :-(
Mark Hahnenberg
Comment 8
2012-05-15 18:43:37 PDT
Committed
r117201
: <
http://trac.webkit.org/changeset/117201
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug