[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] kvm_irqchip_assign_irqfd: just set irqfd in cas
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] kvm_irqchip_assign_irqfd: just set irqfd in case of kvm_irqfds_enabled() |
Date: |
Fri, 26 Dec 2014 17:59:30 +0000 |
On 26 December 2014 at 10:16, Denis V. Lunev <address@hidden> wrote:
> IMHO the patch does not change anything even on hot-hot path.
> the declaration 'struct kvm_irqfd irqfd = {};' will
> result in memset inside.
>
> Thus in order to achieve declared goal author should
> declare
> struct kvm_irqfd irqfd;
> and perform
> memset(&irqfd, 0, sizeof(irqfd));
> later after the check.
Mm, but once you're into such microoptimisations as this you really
need to have a good justification for the effort, in the form of
profiling measurements that indicate that this is a hot path.
In this case that seems pretty unlikely, because I'd expect all
the systems where we care about performance will support irqfds,
so we won't be taking the early-exit code path anyhow. (And
not supporting irqfds is leaving much more performance on the
table than we could possibly be talking about in this function.)
thanks
-- PMM