Mir

Merge lp:~vanvugt/mir/no-savings into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Alexandros Frantzis
Proposed branch: lp:~vanvugt/mir/no-savings
Merge into: lp:mir
Diff against target: 19 lines (+1/-3)
1 file modified
src/server/compositor/multi_threaded_compositor.cpp (+1/-3)
To merge this branch: bzr merge lp:~vanvugt/mir/no-savings
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Carr (community) Needs Information
Alexandros Frantzis (community) Disapprove
Mir development team Pending
Review via email: mp+216084@code.launchpad.net

Commit message

Remove spurious saved_resources vector. The duration of the buffer
acquisition in this case is unimportant, only the frequency of
acquisitions matters.

To post a comment you must log in.
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Not holding the buffer for a reasonable amount of time, is like stealing the buffer from the real compositor. When the timings are right (or wrong rather) this results in speed-ups surges (= essentially dropping buffers). This is what I get on my laptop with mir_demo_server_shell and mir_demo_client_egltriangle:

1 FPS
17 FPS
95 FPS
82 FPS
60 FPS
60 FPS
60 FPS
61 FPS
60 FPS
97 FPS
80 FPS
60 FPS
60 FPS
61 FPS
60 FPS
60 FPS
98 FPS
77 FPS
60 FPS
60 FPS
60 FPS
61 FPS
60 FPS
102 FPS
75 FPS
60 FPS

review: Disapprove
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

Is this supposed to depend on something ?? (i.e. save-resources in renderer)

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

I think we need a consistent rule for how a compostior must consume all the buffers given to it. It is difficult to distill a rule because we using (abusing?) the compositor buffer consuming. Its natural to start to use functions in a different way as the code grows, but I think the time has come to unify the guarantees and the ways we are using lock_compositor_buffer() in these different consumer entities.

for instance:
BufferConsumingFunctor will consume all the buffers on every pass
DefaultDisplayBufferCompositor (bypass) will just consume the bypassed buffer
DefaultDisplayBufferCompositor (not bypass) will consume all non-obscured renderables

this makes it difficult to schedule compositions, and makes it difficult to make guarantees to our clients.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"Stealing buffers" cannot happen the way I designed SwitchingBundle.

Sounds like Alexandros is experiencing a different bug. SwitchingBundle is designed to not consume buffers faster than the fastest unique user_id does. So a client frame rate above 60FPS means one of your compositor threads is running faster than 60 FPS. Either that or it's a new bug in SwitchingBundle.

Can anyone else reproduce > 60FPS? I can't yet...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Robert: No this branch does not depend on anything. Theoretically it just deletes dead code.

Alexandros: Are you able to write a test for the "surges" you experience?

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> Alexandros: Are you able to write a test for the "surges" you experience?

I haven't been able write a test for it yet, since I don't understand exactly what's going on.

Here is a trace excerpt from one of my runs: http://paste.ubuntu.com/7266508/

See the points marked with "###".

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm fairly confident the bug experienced by Alexandros, while real, is not directly caused by this branch. So Disappoved is not appropriate. But something needs fixing before this can land...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Found the problem --> bug 1308843

It does pre-date this proposal, although it's become slightly more pronounced with this branch.

So a fix for bug 1308843 is not strictly a prerequisite to this branch, but probably preferable.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> Found the problem --> bug 1308843

I think the problem described in that bug is different from what I am experiencing. If I understood correctly, bug 1308843 is about the buffer consumption thread consuming at a rate different from the real compositor.
From irc: "duflu: It's exactly the same as multi-monitor with 59.9Hz vs 60.0Hz. With physical displays we accept the beating, but with the virtual one we shouldn't"

However, with this branch, even if I reduce the vsync rate to 10Hz, I still get periodic speed-ups reaching ~65FPS, which contradict an earlier statement that "SwitchingBundle is designed to not consume buffers faster than the fastest unique user_id does". So perhaps we have two different problem in our hands?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No problem. We don't have to prove one way or the other. Just wait till the bug is fixed and then see.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

You essentially have two monitors, one real and one fake. So the spurious frame rate I would expect to see with the aliasing/beating would be anything up to 120Hz.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Wait, that's wrong too. Let me fix the bug first then see.

lp:~vanvugt/mir/no-savings updated
1559. By Daniel van Vugt

Merge latest development-branch

1560. By Daniel van Vugt

Merge latest development-branch

1561. By Daniel van Vugt

Merge latest development-branch

1562. By Daniel van Vugt

Merge latest development-branch and fix conflicts

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We now have four branches proposed to solve bug 1308844 (and they all do solve it). So this one may not be the one that lands.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~vanvugt/mir/no-savings updated
1563. By Daniel van Vugt

Merge latest development-branch

1564. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1565. By Daniel van Vugt

Fix FTBFS from previous commit

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~vanvugt/mir/no-savings updated
1566. By Daniel van Vugt

Merge latest development-branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

As a result of merging the 10Hz branch, this change is not relevant any more.

Unmerged revisions

1566. By Daniel van Vugt

Merge latest development-branch

1565. By Daniel van Vugt

Fix FTBFS from previous commit

1564. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1563. By Daniel van Vugt

Merge latest development-branch

1562. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1561. By Daniel van Vugt

Merge latest development-branch

1560. By Daniel van Vugt

Merge latest development-branch

1559. By Daniel van Vugt

Merge latest development-branch

1558. By Daniel van Vugt

Remove spurious saved_resources vector. The duration of the buffer
acquisition in this case is unimportant, only the frequency of
acquisitions matters.

For a detailed discussion on the topic see also:
https://code.launchpad.net/~vanvugt/mir/save-resources-in-the-renderer/+merge/215197
https://bugs.launchpad.net/mir/+bug/1264934

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/compositor/multi_threaded_compositor.cpp'
2--- src/server/compositor/multi_threaded_compositor.cpp 2014-04-28 23:19:46 +0000
3+++ src/server/compositor/multi_threaded_compositor.cpp 2014-04-30 02:53:24 +0000
4@@ -196,14 +196,12 @@
5 run_compositing_loop(
6 [this]
7 {
8- std::vector<std::shared_ptr<mg::Buffer>> saved_resources;
9-
10 auto const& renderables = scene->renderable_list_for(this);
11
12 for (auto const& r : renderables)
13 {
14 if (r->buffers_ready_for_compositor() > 0)
15- saved_resources.push_back(r->buffer());
16+ r->buffer(); // consume, don't hold the result
17 }
18
19 wait_until_next_fake_vsync();

Subscribers

People subscribed via source and target branches