From: Victor Kaplansky <vkaplans@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, yliu@fridaylinux.org,
tiwei bie <tiwei.bie@intel.com>,
jianfeng tan <jianfeng.tan@intel.com>,
stable@dpdk.org, jfreiman@redhat.com
Subject: Re: [dpdk-dev] [PATCH v2 2/3] vhost: protect dirty logging against logging base change
Date: Mon, 27 Nov 2017 03:42:34 -0500 (EST) [thread overview]
Message-ID: <1602820578.45759784.1511772154833.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <0a577e7b-2d90-04ba-3fac-f70192970a09@redhat.com>
----- Original Message -----
> From: "Maxime Coquelin" <maxime.coquelin@redhat.com>
> To: "Victor Kaplansky" <vkaplans@redhat.com>
> Cc: dev@dpdk.org, yliu@fridaylinux.org, "tiwei bie" <tiwei.bie@intel.com>, "jianfeng tan" <jianfeng.tan@intel.com>,
> stable@dpdk.org, jfreiman@redhat.com
> Sent: Monday, November 27, 2017 10:27:22 AM
> Subject: Re: [PATCH v2 2/3] vhost: protect dirty logging against logging base change
>
> Hi Victor,
>
> On 11/27/2017 09:16 AM, Victor Kaplansky wrote:
> > Hi,
> >
> > While I agree that taking full fledged lock by rte_rwlock_read_lock()
> > solves the race condition,
> > I'm afraid that it would be too expensive in case when logging is off,
> > since it introduces
> > acquiring and releasing lock into the main flow of ring updates.
>
> Actually my v2 fixes the performance penalty when logging is off. The
> lock is now taken after the logging feature check.
>
> But still, I agree logging on case will suffer from a performance
> penalty.
Yes, checking of logging feature is better than nothing, but VHOST_F_LOG_ALL
marks only whether logging is supported by the device and not if
logging is in the action. Thus, any guest will hit the performance
degradation even not during migration.
>
> > It is OK for now, as it fixes the bug, but we need to perform more careful
> > performance measurements,
> > and see whether the performance degradation is not too prohibitive.
> >
> > As alternative, we may consider using more light weighted busy looping.
>
> I think it will end up almost being the same, as both threads will need
> to busy loop. PMD thread to be sure the protocol thread isn't being
> unmapping the region before doing the logging, and protocol thread to be
> sure the PMD thread is not doing logging before handling the set log
> base.
>
I'm not fully aware how rte_rwlock_read_lock() is implemented, but
theoretically busy looping should be much cheaper in cases when
taking lock by one side is very rare.
> Maybe you have something else in mind?
>
> > Also, lets fix by this series the __sync_fetch_and_or_8 ->
> > __sync_fetch_and_or,
> > as it may improve the performance slightly.
>
> Sure, this can be done, but it would need to be benchmarked first.
Agree.
>
> Regards,
> Maxime
>
next prev parent reply other threads:[~2017-11-27 8:42 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 [this message]
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
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=1602820578.45759784.1511772154833.JavaMail.zimbra@redhat.com \
--to=vkaplans@redhat.com \
--cc=dev@dpdk.org \
--cc=jfreiman@redhat.com \
--cc=jianfeng.tan@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=tiwei.bie@intel.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).