From: Paolo Bonzini <pbonzini@redhat.com>
To: Yi Li <yili@winhong.com>
Cc: yilikernel@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm/eventfd:do wildcard calculation before list_for_each_entry_safe
Date: Fri, 11 Sep 2020 19:23:40 +0200 [thread overview]
Message-ID: <20efe3ed-8efa-ed50-bd01-329db676ee86@redhat.com> (raw)
In-Reply-To: <20200911055652.3041762-1-yili@winhong.com>
On 11/09/20 07:56, Yi Li wrote:
> There is no need to calculate wildcard in each loop
> since wildcard is not changed.
>
> Signed-off-by: Yi Li <yili@winhong.com>
> ---
> virt/kvm/eventfd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index d6408bb497dc..c2323c27a28b 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -853,15 +853,17 @@ kvm_deassign_ioeventfd_idx(struct kvm *kvm, enum kvm_bus bus_idx,
> struct eventfd_ctx *eventfd;
> struct kvm_io_bus *bus;
> int ret = -ENOENT;
> + bool wildcard;
>
> eventfd = eventfd_ctx_fdget(args->fd);
> if (IS_ERR(eventfd))
> return PTR_ERR(eventfd);
>
> + wildcard = !(args->flags & KVM_IOEVENTFD_FLAG_DATAMATCH);
> +
> mutex_lock(&kvm->slots_lock);
>
> list_for_each_entry_safe(p, tmp, &kvm->ioeventfds, list) {
> - bool wildcard = !(args->flags & KVM_IOEVENTFD_FLAG_DATAMATCH);
>
> if (p->bus_idx != bus_idx ||
> p->eventfd != eventfd ||
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2020-09-11 17:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 5:56 Yi Li
2020-09-11 17:23 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20efe3ed-8efa-ed50-bd01-329db676ee86@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yili@winhong.com \
--cc=yilikernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®