Commit b862bb1
Adam Ford
Fix fence completion race in virtio-gpu worker
When fences complete out of order (e.g., an immediate-retire for fence
N+1 arrives before the timeline signal for fence N), the unconditional
insert() would overwrite the higher fence_id with the lower one. This
causes fence N+1 to appear incomplete forever, hanging the guest.
Use entry().or_insert() with a max check so only strictly higher
fence_ids update the completed_fences map.
Signed-off-by: Adam Ford <adam.ford@anodize.com>1 parent 3d1c444 commit b862bb1
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
| |||
0 commit comments