From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"yliu@fridaylinux.org" <yliu@fridaylinux.org>,
"Bie, Tiwei" <tiwei.bie@intel.com>,
"vkaplans@redhat.com" <vkaplans@redhat.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
"jfreiman@redhat.com" <jfreiman@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] vhost: protect dirty logging against logging base change
Date: Thu, 22 Feb 2018 02:54:49 +0000 [thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E365144A781@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <4852f365-5c42-1f8e-3a48-467e2a3a2af8@redhat.com>
> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Wednesday, February 14, 2018 3:53 PM
> To: Tan, Jianfeng; dev@dpdk.org; yliu@fridaylinux.org; Bie, Tiwei;
> vkaplans@redhat.com
> Cc: stable@dpdk.org; jfreiman@redhat.com
> Subject: Re: [PATCH v2 2/3] vhost: protect dirty logging against logging base
> change
>
> Hi Jianfeng,
>
> On 02/14/2018 03:03 AM, Tan, Jianfeng wrote:
> > Hi Maxime,
> >
> >
> > On 11/28/2017 6:06 PM, Maxime Coquelin wrote:
> >>
> >>
> >> On 11/24/2017 07:08 PM, Maxime Coquelin wrote:
> >>> When performing live-migration with multiple queue pairs,
> >>> VHOST_USER_SET_LOG_BASE request is sent multiple times.
> >>>
> >>> If packets are being processed by the PMD threads, it is
> >>> possible that they are setting bits in the dirty log map while
> >>> its region is being unmapped by the vhost-user protocol thread.
> >>> It results in the following crash:
> >>> Thread 3 "lcore-slave-2" received signal SIGSEGV, Segmentation fault.
> >>> [Switching to Thread 0x7f71ca495700 (LWP 32451)]
> >>> 0x00000000004bfc8a in vhost_set_bit (addr=0x7f71cbe18432 <error:
> >>> Cannot access memory at address 0x7f71cbe18432>, nr=1) at
> >>> /home/max/projects/src/mainline/dpdk/lib/librte_vhost/vhost.h:267
> >>> 267 __sync_fetch_and_or_8(addr, (1U << nr));
> >>>
> >>> We can see the vhost-user protocol thread just did the unmap of the
> >>> dirty log region when it happens.
> >>>
> >>> This patch prevents this by introducing a RW lock to protect
> >>> the log base.
> >>>
> >>> Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")
> >>> Cc: stable@dpdk.org
> >>>
> >>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>> ---
> >>> lib/librte_vhost/vhost.c | 2 ++
> >>> lib/librte_vhost/vhost.h | 14 +++++++++++---
> >>> lib/librte_vhost/vhost_user.c | 4 ++++
> >>> 3 files changed, 17 insertions(+), 3 deletions(-)
> >>>
> >>
> >> By clarifying the vhost-user spec, we may be able to avoid this lock and
> >> just ignore the subsequent SET_LOG_BASE requests once
> >> VHOST_F_LOG_ALL feature bit is set.
> >>
> >> So let's just discard this series for now.
> >
> > I would assume this issue has been addressed by the per-queue lock patch
> > from Victor, correct?
>
> Correct.
>
> > Besides, we really don't need multiple unmap/map for each vq. Would you
> > think this shall be fixed in QEMU?
>
> Yes, I tihnk you are right it should be fixed in QEMU, so that it is
> sent only for the first queue pair.
>
> But I didn't had time to work on it TBH.
Thank you for the confirmation. And it's not an urgent issue to fix anyway.
next prev parent reply other threads:[~2018-02-22 2:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-24 18:08 [dpdk-dev] [PATCH v2 0/3] vhost: MQ live-migration fixes Maxime Coquelin
2017-11-24 18:08 ` [dpdk-dev] [PATCH v2 1/3] vhost: fix fd leak in VHOST_USER_SET_LOG_BASE Maxime Coquelin
2017-11-24 18:08 ` [dpdk-dev] [PATCH v2 2/3] vhost: protect dirty logging against logging base change Maxime Coquelin
2017-11-27 8:16 ` Victor Kaplansky
2017-11-27 8:27 ` Maxime Coquelin
2017-11-27 8:42 ` Victor Kaplansky
2017-11-27 9:00 ` Maxime Coquelin
2017-11-28 10:06 ` Maxime Coquelin
2018-02-14 2:03 ` Tan, Jianfeng
2018-02-14 7:52 ` Maxime Coquelin
2018-02-22 2:54 ` Tan, Jianfeng [this message]
2017-11-24 18:08 ` [dpdk-dev] [PATCH v2 3/3] vhost: don't invalidate vrings if new addresses are identical Maxime Coquelin
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=ED26CBA2FAD1BF48A8719AEF02201E365144A781@SHSMSX103.ccr.corp.intel.com \
--to=jianfeng.tan@intel.com \
--cc=dev@dpdk.org \
--cc=jfreiman@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=tiwei.bie@intel.com \
--cc=vkaplans@redhat.com \
--cc=yliu@fridaylinux.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).