RESOLVED FIXED 91746
set WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED for chromium android
https://bugs.webkit.org/show_bug.cgi?id=91746
Summary set WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED for chromium android
Wei James (wistoch)
Reported 2012-07-19 08:35:04 PDT
set WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED for chromium android
Attachments
Patch (1016 bytes, patch)
2012-07-19 08:35 PDT, Wei James (wistoch)
no flags
Patch (1.63 KB, patch)
2012-07-26 00:55 PDT, Wei James (wistoch)
no flags
Patch (1.63 KB, patch)
2012-07-26 00:58 PDT, Wei James (wistoch)
no flags
Wei James (wistoch)
Comment 1 2012-07-19 08:35:24 PDT
Adam Barth
Comment 2 2012-07-25 23:22:17 PDT
Comment on attachment 153271 [details] Patch Why?
Wei James (wistoch)
Comment 3 2012-07-25 23:35:15 PDT
(In reply to comment #2) > (From update of attachment 153271 [details]) > Why? it is part of the efforts to enable web audio for chromium android. as mentioned in https://bugs.webkit.org/show_bug.cgi?id=89428#c19 peter wants to seperate the patch to two pieces. the one in #89428 already landed webkit. but I cannot find digit@google.com on bugs.webkit.org so have to turn to you. :)
Adam Barth
Comment 4 2012-07-26 00:02:02 PDT
Would you be willing to include this information in the ChangeLog? As written the patch is very mysterious.
Adam Barth
Comment 5 2012-07-26 00:03:01 PDT
From the name, WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED sounds like it could have much wider implications than just web audio. Are we sure we want those implications? Do we turn this on for Chromium on other operating systems?
Wei James (wistoch)
Comment 6 2012-07-26 00:25:07 PDT
(In reply to comment #4) > Would you be willing to include this information in the ChangeLog? As written the patch is very mysterious. sure. I will update the patch to include this information. thanks
Wei James (wistoch)
Comment 7 2012-07-26 00:31:24 PDT
(In reply to comment #5) > From the name, WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED sounds like it could have much wider implications than just web audio. Are we sure we want those implications? Do we turn this on for Chromium on other operating systems? I was confused too when I saw this MACRO at the begining. this MACRO is to eanble using WTF::atomicDecrement and WTF::atomicIncreament in wtf/Atomics.h from wtf/Atomics.h, seems all other OS and platforms enabled this MACRO.
Wei James (wistoch)
Comment 8 2012-07-26 00:33:04 PDT
(In reply to comment #5) > From the name, WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED sounds like it could have much wider implications than just web audio. Are we sure we want those implications? Do we turn this on for Chromium on other operating systems? it is not just for web audio. it is for wtf::atomicDecrement and wtf::atomicIncrement. Web Audio just needs to use atomicDecrement and atomicIncrement.
Wei James (wistoch)
Comment 9 2012-07-26 00:55:45 PDT
Wei James (wistoch)
Comment 10 2012-07-26 00:58:12 PDT
Wei James (wistoch)
Comment 11 2012-07-26 01:02:14 PDT
after reviewing the comments in #89428, it may make more sense to put this MACRO in Atomics.h. also, added more information in ChangeLog. thanks
Adam Barth
Comment 12 2012-07-26 01:54:33 PDT
Comment on attachment 154567 [details] Patch Thanks! This patch makes much more sense.
Peter Beverloo
Comment 13 2012-07-26 01:55:55 PDT
I've asked David Turner to have a quick peek as well, as I vaguely recall issues with this. I can set CQ+ once we're good. Thank you, James Wei!
Wei James (wistoch)
Comment 14 2012-07-26 01:57:30 PDT
(In reply to comment #12) > (From update of attachment 154567 [details]) > Thanks! This patch makes much more sense. thanks!
Wei James (wistoch)
Comment 15 2012-07-26 01:57:47 PDT
(In reply to comment #13) > I've asked David Turner to have a quick peek as well, as I vaguely recall issues with this. I can set CQ+ once we're good. Thank you, James Wei! that's fine. thanks!
Peter Beverloo
Comment 16 2012-07-27 06:14:42 PDT
The issues were fixed starting the release of r7b of the Android NDK, which is what WebKit uses. Setting cq+, thank you for the patch!
WebKit Review Bot
Comment 17 2012-07-27 07:15:07 PDT
Comment on attachment 154567 [details] Patch Clearing flags on attachment: 154567 Committed r123875: <http://trac.webkit.org/changeset/123875>
WebKit Review Bot
Comment 18 2012-07-27 07:15:11 PDT
All reviewed patches have been landed. Closing bug.
Alexandre Elias
Comment 19 2012-07-30 01:03:48 PDT
This is causing FunctionalTest.MemberFunctionBindRefDeref in the TestWebKitAPI test package to fail on our private bot.
Alexandre Elias
Comment 20 2012-07-30 01:08:46 PDT
Not sure of the reason why it has issues on Android, given that the setting is enabled on many other platforms without problems. Wei, could you investigate?
Alexandre Elias
Comment 21 2012-07-30 01:18:13 PDT
In webkit_unit_tests package, IDBDatabaseBackendTest.BackingStoreRetention is also failing with backingStore->hasOneRef() (Actual: false, Expected: true).
Wei James (wistoch)
Comment 22 2012-07-30 01:30:18 PDT
(In reply to comment #20) > Not sure of the reason why it has issues on Android, given that the setting is enabled on many other platforms without problems. Wei, could you investigate? ok. I will investigate it.
Peter Beverloo
Comment 23 2012-07-30 02:11:52 PDT
I think it's unreasonable to ask Wei James to investigate issues occurring on our private branch. We should pick this up ourselves. Alexandre, what version of the Android NDK do we use downstream? The atomic operations should be safe to use starting version r7b..
Wei James (wistoch)
Comment 24 2012-07-30 02:53:54 PDT
(In reply to comment #23) > I think it's unreasonable to ask Wei James to investigate issues occurring on our private branch. We should pick this up ourselves. > > Alexandre, what version of the Android NDK do we use downstream? The atomic operations should be safe to use starting version r7b.. peter, I can reproduce this issue in chromium upstream with ndk r8. it is strange as __atomic_inc is implemented with __sync_fetch_and_add in r8.
Wei James (wistoch)
Comment 25 2012-07-30 04:11:08 PDT
(In reply to comment #24) > (In reply to comment #23) > > I think it's unreasonable to ask Wei James to investigate issues occurring on our private branch. We should pick this up ourselves. > > > > Alexandre, what version of the Android NDK do we use downstream? The atomic operations should be safe to use starting version r7b.. > > peter, I can reproduce this issue in chromium upstream with ndk r8. > > it is strange as __atomic_inc is implemented with __sync_fetch_and_add in r8. I have found the root cause of this issue. __atomic_inc is safe to use in android. but in WebKit, it is assumed that __atomic_inc will return the new value. while in Android, __sync_fetch_and_add will return the old value. so ThreadSafeRefCounted.h, Line 108: should be atomicDecrement(&m_refCount) <= 1 in android instead of atomicDecrement(&m_refCount) <= 0 I will refine and submit the patch later for review. thanks
Peter Beverloo
Comment 26 2012-07-30 16:54:20 PDT
Marking this as fixed again.
Note You need to log in before you can comment on or make changes to this bug.