• David Stevens's avatar
    virtio_balloon: Give the balloon its own wakeup source · 810d831b
    David Stevens authored
    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: b12fbc3f ("virtio_balloon: stay awake while adjusting balloon")
    Signed-off-by: default avatarDavid Stevens <stevensd@chromium.org>
    Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
    Message-Id: <20240321012445.1593685-2-stevensd@google.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    810d831b
virtio_balloon.c 34 KB