Bug 44179

Summary: SPICE_MSG_WAIT_FOR_CHANNELS is not handled
Product: Spice Reporter: Yonit Halperin <yhalperi>
Component: spice-gtkAssignee: Spice Bug List <spice-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Implement SPICE_MSG_WAIT_FOR_CHANNELS
Wait for channels before invalidating images

Description Yonit Halperin 2011-12-27 05:27:00 UTC
When this msg arrives to a channel it should wait and do nothing till all the other channels that are specified in the msg will reach the corresponding msg serial ids that are part of the msg.
It is important for holding the shared pixmap cache consistent. Otherwise, one display channel might remove a pixmap from the cache, while another display channel might try to access it after the removal.
Comment 1 Marc-Andre Lureau 2011-12-27 06:28:48 UTC
In which conditions this message is sent? It would be helpful to have a test case.

thanks
Comment 2 Yonit Halperin 2011-12-27 11:15:19 UTC
(In reply to comment #1)
> In which conditions this message is sent? It would be helpful to have a test
> case.
> 
> thanks

-More than 1 guest monitor
- Pixmap cache size exceeds its limit when trying to insert a new bitmap
- As a result the oldest bitmaps in the cache are removed from it
- Each such bitmap occurrence holds for each one of the display channels the serial number of the last message that referred to this cache item.
WAIT_FOR_CHANNELS is sent to client before INVAL_LIST, together with these serial numbers (for all the display channels, except for the one that the message is desalinated to). This way we prevent display channel x from removing bitmap b from the cache, before message m that refers to b arrived to display channel y.
WAIT_FOR_CHANNELS will be sent only if one of the other channels actually used on of the removed cache bitmaps.

In addition, for similar reasons, wait_for_channels should also be called in channel-display::display_handle_inv_pixmap_all before reseting the cache.
Comment 3 Marc-Andre Lureau 2012-01-04 07:27:03 UTC
Created attachment 55113 [details] [review]
Implement SPICE_MSG_WAIT_FOR_CHANNELS
Comment 4 Marc-Andre Lureau 2012-01-04 07:27:06 UTC
Created attachment 55114 [details] [review]
Wait for channels before invalidating images
Comment 5 Yonit Halperin 2012-01-08 03:16:56 UTC
Comment on attachment 55113 [details] [review]
Implement SPICE_MSG_WAIT_FOR_CHANNELS

Review of attachment 55113 [details] [review]:
-----------------------------------------------------------------

Looks good.
Comment 6 Yonit Halperin 2012-01-08 03:17:36 UTC
Comment on attachment 55114 [details] [review]
Wait for channels before invalidating images

Review of attachment 55114 [details] [review]:
-----------------------------------------------------------------

Looks good
Comment 7 Yonit Halperin 2012-01-08 03:49:47 UTC
bug 44570 is similar to this bug: not waiting till images that should appear in the cache are actually added to the cache.
Comment 8 Marc-Andre Lureau 2012-01-08 05:29:24 UTC
committed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.