Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Issue 11411251: Use a lock to deal with concurrent access to the m_evictedBackings (Closed)

Created:
8 years ago by ccameron
Modified:
8 years ago
Reviewers:
jamesr, enne (OOO), piman
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

Use a mutex to deal with concurrent access to the m_evictedBackings list, instead of passing the list of pointers around. In ThreadProxy::beginFrame, we unlink all evicted textures, so that the call to updateLayers will know to re-paint the evicted layers. In ThreadProxy::scheduleActionCommit, we determine if we can draw now by checking to see if there exist any linked evicted textures. If there are none, we can draw what we are in the process of committing. This assumes that once we get to m_layerTreeHost->willBeginFrame() in ThreadProxy::beginFrame, the next frame to be commited by ThreadProxy::scheduleActionCommit be at or after the frame that is being produced by that call to ThreadProxy::beginFrame. BUG=158747 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170403

Patch Set 1 #

Total comments: 6

Patch Set 2 : Incorporate review feedback #

Total comments: 4

Patch Set 3 : Incorporate review feedback #

Patch Set 4 : Make lock mutable #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -83 lines) Patch
M cc/prioritized_resource.h View 1 chunk +0 lines, -5 lines 0 comments Download
M cc/prioritized_resource.cc View 4 chunks +3 lines, -5 lines 0 comments Download
M cc/prioritized_resource_manager.h View 1 2 4 chunks +14 lines, -8 lines 0 comments Download
M cc/prioritized_resource_manager.cc View 1 2 6 chunks +9 lines, -39 lines 0 comments Download
M cc/prioritized_resource_unittest.cc View 2 chunks +9 lines, -5 lines 0 comments Download
M cc/single_thread_proxy.cc View 1 chunk +1 line, -7 lines 0 comments Download
M cc/thread_proxy.h View 1 chunk +0 lines, -1 line 0 comments Download
M cc/thread_proxy.cc View 1 2 3 3 chunks +6 lines, -10 lines 0 comments Download
M cc/tiled_layer_unittest.cc View 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
ccameron
This gets rid of passing lists of pointers to backings between the threads, and rather ...
8 years ago (2012-11-29 00:58:33 UTC) #1
ccameron
This is causing lots of crashes on TOT -- ptal.
8 years ago (2012-11-29 18:22:24 UTC) #2
ccameron
8 years ago (2012-11-29 18:22:34 UTC) #3
jamesr
https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h File cc/prioritized_resource_manager.h (right): https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h#newcode95 cc/prioritized_resource_manager.h:95: void unlinkAndClearEvictedBackings(); You should document that this can be ...
8 years ago (2012-11-29 22:06:16 UTC) #4
piman
https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h File cc/prioritized_resource_manager.h (right): https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h#newcode95 cc/prioritized_resource_manager.h:95: void unlinkAndClearEvictedBackings(); On 2012/11/29 22:06:16, jamesr wrote: > You ...
8 years ago (2012-11-29 22:24:09 UTC) #5
ccameron
Thanks!! Yes -- it's main thread. https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h File cc/prioritized_resource_manager.h (right): https://codereview.chromium.org/11411251/diff/1/cc/prioritized_resource_manager.h#newcode95 cc/prioritized_resource_manager.h:95: void unlinkAndClearEvictedBackings(); On ...
8 years ago (2012-11-29 22:25:34 UTC) #6
piman
LGTM+nits https://codereview.chromium.org/11411251/diff/3003/cc/prioritized_resource_manager.cc File cc/prioritized_resource_manager.cc (right): https://codereview.chromium.org/11411251/diff/3003/cc/prioritized_resource_manager.cc#newcode350 cc/prioritized_resource_manager.cc:350: bool PrioritizedResourceManager::linkedEvictedBackingsExist() nit: you can keep this const ...
8 years ago (2012-11-29 22:34:11 UTC) #7
ccameron
https://codereview.chromium.org/11411251/diff/1/cc/thread_proxy.cc File cc/thread_proxy.cc (right): https://codereview.chromium.org/11411251/diff/1/cc/thread_proxy.cc#newcode574 cc/thread_proxy.cc:574: m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings(); On 2012/11/29 22:06:16, jamesr wrote: > we don't ...
8 years ago (2012-11-29 23:51:43 UTC) #8
ccameron
Thanks!! https://codereview.chromium.org/11411251/diff/3003/cc/prioritized_resource_manager.cc File cc/prioritized_resource_manager.cc (right): https://codereview.chromium.org/11411251/diff/3003/cc/prioritized_resource_manager.cc#newcode350 cc/prioritized_resource_manager.cc:350: bool PrioritizedResourceManager::linkedEvictedBackingsExist() On 2012/11/29 22:34:11, piman wrote: > ...
8 years ago (2012-11-30 00:02:17 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ccameron@chromium.org/11411251/8011
8 years ago (2012-11-30 01:07:06 UTC) #10
jamesr
On 2012/11/29 23:51:43, ccameron1 wrote: > https://codereview.chromium.org/11411251/diff/1/cc/thread_proxy.cc > File cc/thread_proxy.cc (right): > > https://codereview.chromium.org/11411251/diff/1/cc/thread_proxy.cc#newcode574 > ...
8 years ago (2012-11-30 02:32:45 UTC) #11
commit-bot: I haz the power
Change committed as 170403
8 years ago (2012-11-30 05:21:16 UTC) #12
ccameron
8 years ago (2012-11-30 09:52:28 UTC) #13
Message was sent while issue was closed.
On 2012/11/30 02:32:45, jamesr wrote:
> OK, but could you look at cleaning this up as a follow-up?  The animate and
> layout steps can take quite some time, so we're using unnecessarily stale
> values.

What motivates this the most for me is that the test is "doing it wrong" -- the
tests should have pretend updateLayers() calls, and not just be hijacking
layout() for "stuff that happens vaguely near layout()".  That's a pretty
pervasive problem in the tests.

In terms of optimizations, I should be clear that this patch is a strict
improvement over the existing situation (where our snapshot came from the impl
thread quite some time ago before). The path is also slated for destruction with
impl-side painting, so I'd prefer not to invest much in its further
optimization, at least while there are more pressing issues.

The correctness issue of the tests, though, is concerning (and I do wonder what
the tests will look like when impl-side painting is added -- perhaps the looser
tests will be replaced).

Powered by Google App Engine
This is Rietveld 408576698