Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store a queue of rasterized blobs instead for non-tiled images (take two) #3111

Merged
merged 4 commits into from Sep 25, 2018

Conversation

@nical
Copy link
Collaborator

nical commented Sep 24, 2018

The 3 commits from #3079 which were reverted in #3108 plus a commit that fixes the crash that motivated the backout.

Bugzilla entry: https://bugzilla.mozilla.org/show_bug.cgi?id=1493177

In the texture cache we have an automatic and a manual eviction policy. The manual eviction policy ensures blob images don't get automatically evicted from the cache which could otherwise race with the asynchronous rasterization. The Texture cache was missing a tiny piece of code to ensure the eviction policy was respected in for shared cache entries (it does work for normal cache entries). I bet border images make uses of these shared entries. While scrolling the image eventually gets discarded and next time we see it we request the image. The problem is that when we decide whether a blob image is missing, we only look at whether there is an entry in the rasterized_blob_image map, but we don't check whether that entry contains any actual data to upload in its queue.

Before the regressing commit, the bug would occur without crashing, but we wouldn't necessary upload all of the image (only the last available dirty region). With that commit we end up requesting something we think we have but don't have and later panic with an empty handed upload request.


This change is Reviewable

@jrmuizel
Copy link
Contributor

jrmuizel commented Sep 24, 2018

FWIW, I was thinking about this approach some more and think it would probably be better to just keep a copy of the whole rasterized blob around in memory instead of having the accumulating queue of updates

@nical
Copy link
Collaborator Author

nical commented Sep 24, 2018

This is blocking a bunch of other things, so if we want to pursue another approach, let's first land it and then implement something else so that the other work can land.

I'm rather neutral about whether we should retain the whole blob in memory and paint over it or do this queued thing. In principle the former feels cleaner. It might be harder to implement because it isn't clear which thread can own the retained rasterized blobs. Also in theory it involves copying more memory but I'm not sure whether that really matters.

@jrmuizel
Copy link
Contributor

jrmuizel commented Sep 24, 2018

I agree that we should land this first.

@kvark
kvark approved these changes Sep 24, 2018
Copy link
Member

kvark left a comment

:lgtm:

Reviewed 2 of 2 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@kvark
Copy link
Member

kvark commented Sep 24, 2018

@nical looks reasonable! Are you confident to land this without a try push?

@nical
Copy link
Collaborator Author

nical commented Sep 24, 2018

I have both the confidence and the try push (although the latter has commits from another PR in addition to this one).

@kvark
Copy link
Member

kvark commented Sep 24, 2018

well, ship it then!
@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2018

📌 Commit cc61e45 has been approved by kvark

@nical
Copy link
Collaborator Author

nical commented Sep 25, 2018

What's up @bors-servo ?

@staktrace
Copy link
Contributor

staktrace commented Sep 25, 2018

Mac CI is busted. Some sort of expired cert problem when the worker tries to upload the log to taskcluster.

@nical
Copy link
Collaborator Author

nical commented Sep 25, 2018

@bors-servo retry

bors-servo added a commit that referenced this pull request Sep 25, 2018
Store a queue of rasterized blobs instead for non-tiled images (take two)

The 3 commits from #3079 which were reverted in #3108 plus a commit that fixes the crash that motivated the backout.

Bugzilla entry: https://bugzilla.mozilla.org/show_bug.cgi?id=1493177

In the texture cache we have an automatic and a manual eviction policy. The manual eviction policy ensures blob images don't get automatically evicted from the cache which could otherwise race with the asynchronous rasterization. The Texture cache was missing a tiny piece of code to ensure the eviction policy was respected in for shared cache entries (it does work for normal cache entries). I bet border images make uses of these shared entries. While scrolling the image eventually gets discarded and next time we see it we request the image. The problem is that when we decide whether a blob image is missing, we only look at whether there is an entry in the rasterized_blob_image map, but we don't check whether that entry contains any actual data to upload in its queue.

Before the regressing commit, the bug would occur without crashing, but we wouldn't necessary upload all of the image (only the last available dirty region). With that commit we end up requesting something we think we have but don't have and later panic with an empty handed upload request.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3111)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2018

Testing commit cc61e45 with merge 7af2936...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2018

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: kvark
Pushing 7af2936 to master...

@bors-servo bors-servo merged commit cc61e45 into servo:master Sep 25, 2018
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
code-review/reviewable 2 files reviewed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.