From: David Marchand <david.marchand@redhat.com>
To: David Marchand <david.marchand@redhat.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, stable@dpdk.org, Chenbo Xia <chenbox@nvidia.com>
Subject: Re: [PATCH v2] vhost: fix VDUSE device destruction failure
Date: Tue, 5 Mar 2024 10:05:10 +0100 [thread overview]
Message-ID: <CAJFAV8w3SOCDNy8k+XJ3=kKhVLbZt2T6Y_QsfS3vVuLs2w6qXw@mail.gmail.com> (raw)
In-Reply-To: <20240304103558.1500695-1-david.marchand@redhat.com>
On Mon, Mar 4, 2024 at 11:36 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> VDUSE_DESTROY_DEVICE ioctl can fail because the device's
> chardev is not released despite close syscall having been
> called. It happens because the events handler thread is
> still polling the file descriptor.
>
> fdset_pipe_notify() is not enough because it does not
> ensure the notification has been handled by the event
> thread, it just returns once the notification is sent.
>
> To fix this, this patch introduces a synchronization
> mechanism based on pthread's condition, so that
> fdset_pipe_notify_sync() only returns once the pipe's
> read callback has been executed.
>
> Fixes: 51d018fdac4e ("vhost: add VDUSE events handler")
> Cc: stable@dpdk.org
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v1:
> - sync'd only when in VDUSE destruction path,
> - added explicit init of sync_mutex,
Applied, thanks.
--
David Marchand
next prev parent reply other threads:[~2024-03-05 9:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 12:24 [PATCH 0/7] vhost: FD manager improvements Maxime Coquelin
2024-02-29 12:24 ` [PATCH 1/7] vhost: fix VDUSE device destruction failure Maxime Coquelin
2024-02-29 13:31 ` David Marchand
2024-03-04 10:35 ` [PATCH v2] " David Marchand
2024-03-04 15:12 ` Maxime Coquelin
2024-03-05 9:05 ` David Marchand [this message]
2024-02-29 12:24 ` [PATCH 2/7] vhost: rename polling mutex Maxime Coquelin
2024-02-29 13:41 ` David Marchand
2024-02-29 12:24 ` [PATCH 3/7] vhost: make use of FD manager init function Maxime Coquelin
2024-02-29 13:42 ` David Marchand
2024-02-29 12:24 ` [PATCH 4/7] vhost: hide synchronization within FD manager Maxime Coquelin
2024-02-29 12:25 ` [PATCH 5/7] vhost: improve fdset initialization Maxime Coquelin
2024-02-29 12:25 ` [PATCH 6/7] vhost: convert fdset sync to eventfd Maxime Coquelin
2024-02-29 12:25 ` [PATCH 7/7] vhost: improve FD manager logging Maxime Coquelin
2024-03-04 10:35 ` [PATCH 0/7] vhost: FD manager improvements David Marchand
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='CAJFAV8w3SOCDNy8k+XJ3=kKhVLbZt2T6Y_QsfS3vVuLs2w6qXw@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).