Skip to content

virtio-gpu: Force RCU when unmapping blob

Akihiko Odaki qemu-devel 4 versions – New

Get series with b4
b4 am [email protected] change-id 20251027-force_rcu-616c743373f7

Versions newest first

  1. v4 Latest6 patches 0 repliesNew
  2. v35 patches 2 repliesSuperseded
  3. v26 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches23 repliesSuperseded

Changes in v4 from the cover letter

- Keep qemu_event_wait() retrying so it preserves wait-forever
semantics.
- Add "scripts/checkpatch: Avoid false positive on empty blocks" to
cover the empty wait loop introduced by
"qemu-thread: Add qemu_event_timedwait()".
- Link to v3: https://lore.kernel.org/qemu-devel/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6futex: Add qemu_futex_timedwait()include/qemu/futex.h+31 -50 replies
2/6qemu-thread: Add qemu_event_timedwait()include/qemu/thread-posix.h include/qemu/thread.h util/event.c +1 more+46 -160 replies
3/6rcu: Use call_rcu() in synchronize_rcu()util/rcu.c+27 -240 replies
4/6rcu: Wake the RCU thread when draininginclude/qemu/rcu.h util/rcu.c+32 -200 replies
5/6virtio-gpu: Force RCU when unmapping blobhw/display/virtio-gpu-virgl.c+1 -00 replies
6/6scripts/checkpatch: Avoid false positive on empty blocksscripts/checkpatch.pl+2 -10 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchDmitry Osipenko
1/6T-b
2/6T-b
3/6T-b
4/6T-b
5/6T-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/6] virtio-gpu: Force RCU when unmapping blob

Unmapping a blob changes the memory map, which is protected with RCU. RCU is designed to minimize the read-side overhead at the cost of reclamation delay. While this design usually makes sense, it is problematic when unmapping a blob because the operation blocks all virtio-gpu commands and causes perceivable disruption.

Minimize such the disruption with force_rcu(), which minimizes the reclamation delay at the cost of a read-side overhead.

---
Changes in v4:
- Keep qemu_event_wait() retrying so it preserves wait-forever
semantics.
- Add "scripts/checkpatch: Avoid false positive on empty blocks" to
cover the empty wait loop introduced by
"qemu-thread: Add qemu_event_timedwait()".
- Link to v3: https://lore.kernel.org/qemu-devel/[email protected]

Changes in v3:
- Fix immediate timeout in qemu_futex_timedwait() for Windows.
- Dropped patch "timer: Rename init_clocks() to qemu_clock_init()".
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]

Changes in v2:
- Stopped overloading the call_rcu1() and force_rcu() notifications onto
one event. This fixes a deadlock after try_dequeue() caused by
incorrect masking of call_rcu1() notifications, and eliminates
spurious force quiescent states caused by being confused with a
call_rcu1() notification.
changes the logic significantly.
- Merged the rcu_call_count and forced variables into one to avoid
the race between them that used to require a loop to resolve.
- Aligned the type of the duration variable in qemu_futex_timedwait()
for Windows.
- Fixed timespec of qemu_futex_timedwait() for 32-bit Linux.
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]

---
Akihiko Odaki (6):
futex: Add qemu_futex_timedwait()
qemu-thread: Add qemu_event_timedwait()
rcu: Use call_rcu() in synchronize_rcu()
rcu: Wake the RCU thread when draining
virtio-gpu: Force RCU when unmapping blob scripts/checkpatch: Avoid false positive on empty blocks

 include/qemu/futex.h          | 36 +++++++++++++---
 include/qemu/rcu.h            |  1 +
 include/qemu/thread-posix.h   | 11 +++++
 include/qemu/thread.h         |  9 +++-
 hw/display/virtio-gpu-virgl.c |  1 +
 util/event.c                  | 31 +++++++++++---
 util/qemu-thread-posix.c      | 11 +----
 util/rcu.c                    | 98 ++++++++++++++++++++++++-------------------
 scripts/checkpatch.pl         |  3 +-
 9 files changed, 137 insertions(+), 64 deletions(-)

---
base-commit: 98b060da3a4f92b2a994ead5b16a87e783baf77c
change-id: 20251027-force_rcu-616c743373f7

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>