mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: "Longpeng(Mike)" <longpeng2@huawei.com>, pbonzini@redhat.com
Cc: cornelia.huck@de.ibm.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, arei.gonglei@huawei.com
Subject: Re: [PATCH] kvm/eventfd: fix the misleading comment in kvm_irqfd_assign
Date: Mon, 29 Nov 2021 18:13:39 +0100	[thread overview]
Message-ID: <c6b7c933-2d48-1504-7c45-110b0ab317ad@linux.ibm.com> (raw)
In-Reply-To: <20211129034328.1604-1-longpeng2@huawei.com>



Am 29.11.21 um 04:43 schrieb Longpeng(Mike):
> From: Longpeng <longpeng2@huawei.com>
> 
> The comment above the invocation of vfs_poll() is misleading, move
> it to the right place.
> 
I think that the current variant is better.
events is only used in that function to check for EPOLLIN, so the
assignment and the if belong together from a "what am I doing here" perspective.

> Fixes: 684a0b719ddb ("KVM: eventfd: Fix lock order inversion")
> Signed-off-by: Longpeng <longpeng2@huawei.com>
> ---
>   virt/kvm/eventfd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 2ad013b..cd01814 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -406,12 +406,12 @@ bool __attribute__((weak)) kvm_arch_irqfd_route_changed(
> 
>   	spin_unlock_irq(&kvm->irqfds.lock);
> 
> +	events = vfs_poll(f.file, &irqfd->pt);
> +
>   	/*
>   	 * Check if there was an event already pending on the eventfd
>   	 * before we registered, and trigger it as if we didn't miss it.
>   	 */
> -	events = vfs_poll(f.file, &irqfd->pt);
> -
>   	if (events & EPOLLIN)
>   		schedule_work(&irqfd->inject);
> 

  reply	other threads:[~2021-11-29 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29  3:43 Longpeng(Mike)
2021-11-29 17:13 ` Christian Borntraeger [this message]
2021-12-03  3:03   ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)

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=c6b7c933-2d48-1504-7c45-110b0ab317ad@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=arei.gonglei@huawei.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longpeng2@huawei.com \
    --cc=pbonzini@redhat.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®