kvm/eventfd: avoid loop inside irqfd_update()
The loop(for) inside irqfd_update() is unnecessary because any other value for irq_entry.type will just trigger schedule_work(&irqfd->inject) in irqfd_wakeup. Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Vitaly Kuznetsov <vkuznets@redhat.com> CC: "K. Y. Srinivasan" <kys@microsoft.com> CC: Gleb Natapov <gleb@kernel.org> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7cae2bedcb
commit
351dc6477c
|
@ -238,20 +238,17 @@ static void irqfd_update(struct kvm *kvm, struct kvm_kernel_irqfd *irqfd)
|
||||||
{
|
{
|
||||||
struct kvm_kernel_irq_routing_entry *e;
|
struct kvm_kernel_irq_routing_entry *e;
|
||||||
struct kvm_kernel_irq_routing_entry entries[KVM_NR_IRQCHIPS];
|
struct kvm_kernel_irq_routing_entry entries[KVM_NR_IRQCHIPS];
|
||||||
int i, n_entries;
|
int n_entries;
|
||||||
|
|
||||||
n_entries = kvm_irq_map_gsi(kvm, entries, irqfd->gsi);
|
n_entries = kvm_irq_map_gsi(kvm, entries, irqfd->gsi);
|
||||||
|
|
||||||
write_seqcount_begin(&irqfd->irq_entry_sc);
|
write_seqcount_begin(&irqfd->irq_entry_sc);
|
||||||
|
|
||||||
irqfd->irq_entry.type = 0;
|
|
||||||
|
|
||||||
e = entries;
|
e = entries;
|
||||||
for (i = 0; i < n_entries; ++i, ++e) {
|
if (n_entries == 1)
|
||||||
/* Only fast-path MSI. */
|
irqfd->irq_entry = *e;
|
||||||
if (e->type == KVM_IRQ_ROUTING_MSI)
|
else
|
||||||
irqfd->irq_entry = *e;
|
irqfd->irq_entry.type = 0;
|
||||||
}
|
|
||||||
|
|
||||||
write_seqcount_end(&irqfd->irq_entry_sc);
|
write_seqcount_end(&irqfd->irq_entry_sc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue