]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
virtio_balloon: Give the balloon its own wakeup source
authorDavid Stevens <stevensd@chromium.org>
Thu, 21 Mar 2024 01:24:44 +0000 (10:24 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 22 May 2024 12:31:16 +0000 (08:31 -0400)
commit810d831bbbf3cbd86e5aa91c8485b4d35186144d
tree9111500db40912e1239edd7e6ab5c389a123043a
parente4544c550eb1857845bb7114bac53edd04dc078f
virtio_balloon: Give the balloon its own wakeup source

Wakeup sources don't support nesting multiple events, so sharing a
single object between multiple drivers can result in one driver
overriding the wakeup event processing period specified by another
driver. Have the virtio balloon driver use the wakeup source of the
device it is bound to rather than the wakeup source of the parent
device, to avoid conflicts with the transport layer.

Note that although the virtio balloon's virtio_device itself isn't what
actually wakes up the device, it is responsible for processing wakeup
events. In the same way that EPOLLWAKEUP uses a dedicated wakeup_source
to prevent suspend when userspace is processing wakeup events, a
dedicated wakeup_source is necessary when processing wakeup events in a
higher layer in the kernel.

Fixes: b12fbc3f787e ("virtio_balloon: stay awake while adjusting balloon")
Signed-off-by: David Stevens <stevensd@chromium.org>
Acked-by: David Hildenbrand <david@redhat.com>
Message-Id: <20240321012445.1593685-2-stevensd@google.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_balloon.c