• Dmytro Maluka's avatar
    KVM: irqfd: Make resampler_list an RCU list · d583fbd7
    Dmytro Maluka authored
    It is useful to be able to do read-only traversal of the list of all the
    registered irqfd resamplers without locking the resampler_lock mutex.
    In particular, we are going to traverse it to search for a resampler
    registered for the given irq of an irqchip, and that will be done with
    an irqchip spinlock (ioapic->lock) held, so it is undesirable to lock a
    mutex in this context. So turn this list into an RCU list.
    
    For protecting the read side, reuse kvm->irq_srcu which is already used
    for protecting a number of irq related things (kvm->irq_routing,
    irqfd->resampler->list, kvm->irq_ack_notifier_list,
    kvm->arch.mask_notifier_list).
    Signed-off-by: default avatarDmytro Maluka <dmy@semihalf.com>
    Message-Id: <20230322204344.50138-2-dmy@semihalf.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    d583fbd7
eventfd.c 23 KB