Description[oilpan]: RFC: Change DatabaseBackendBase::performOpenAndVerify locking
This is a request for comment and should not necessarily be commited.
When looking at the timeout in the terminate-during-sync-operation-websql.html test I found that we are holding a global lock (guidMutex) while doing sync database operations.
The tests starts multiple threads all of which try to open the database. One thread gets the lock and the remaining will block waiting for the lock. None of these threads are in a safepoint at this point. I cannot add a safepoint scope at this point since the code will do allocations.
Instead what I have tried is to release the lock while doing the database operations. This does mean multiple threads might end up trying to create the info table, but I have changed the code so only one of them get to commit the transaction to be as close to the previous semantic as possible.
I should mention that all the waiting threads might not be in performOpenAndVerify, but common is that they are all waiting on the guidMutex which is taken in other methods. Basically any thread taking the guidMutex can block other threads progress since it is a global lock. Doing a sync operation while holding this lock is as such not a good idea.
This change does make the test work without timing out.
R=ager@chromium.org, erik.corry@gmail.com, haraken@chromium.org, oilpan-reviews@chromium.org, tkent@chromium.org, vegorov@chromium.org, zerny@chromium.org, kinuko@chromium.org, morrita@chromium.org
BUG=375671
Patch Set 1 #
Total comments: 1
Messages
Total messages: 5 (0 generated)
|