All of lore.kernel.org
 help / color / mirror / Atom feed
From: Victor Kaplansky <vkaplans@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] vhost-user spec: Clarify policy on setting log_base
Date: Tue, 28 Nov 2017 12:29:04 -0500 (EST)	[thread overview]
Message-ID: <1183103709.47097586.1511890144875.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20171128181306-mutt-send-email-mst@kernel.org>

> From: "Michael S. Tsirkin" <mst@redhat.com>
> To: "Victor Kaplansky" <vkaplans@redhat.com>
> Cc: qemu-devel@nongnu.org, "Maxime Coquelin" <maxime.coquelin@redhat.com>
> Sent: Tuesday, November 28, 2017 6:16:32 PM
> Subject: Re: [PATCH] vhost-user spec: Clarify policy on setting log_base
> 
> On Tue, Nov 28, 2017 at 03:46:44PM +0200, Victor Kaplansky wrote:
> > From: Victor Kaplansky <vkaplans@dell9020.localdomain>
> > 
> > If we allow qemu to change logging area after it was already established,
> > it may require from the backend to acquire a lock on each access to
> > the log_base, which has a potential quite a big performance hit.

> 
> Do we actually issue VHOST_USER_SET_LOG_BASE when ring is started?
> 
> Can we put it simpler:
> 
> 	master must not send VHOST_USER_SET_LOG_BASE when ring
> 	is started and logging of used ring writes is started.
> 
> ?

I'm OK with this phrasing from DPDK point of view, the problem is
that right now qemu issues VHOST_USER_SET_LOG_BASE for each queue
pair, which causes backend to remap logging area, which is very
prone to race conditions without full fledged lock on log_base variable.

The several set_log_base requests by qemu are to the same logging area
with the same size, but a backend cannot know this, since the information is
passed by fd (file descriptor).

So, if we use the word *must* it will *require* a change in QEMU, to
issue single set_log_base for all queue pairs, and not once per queue
pair, as it is done now.

> 
> >  Note that when logging modifications to the used ring (when
> >  VHOST_VRING_F_LOG
> >  is set for this ring), log_guest_addr should be used to calculate the log
> >  offset: the write to first byte of the used ring is logged at this offset
> >  from
> > --
> > 2.14.2
> 

  reply	other threads:[~2017-11-28 17:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 13:46 [Qemu-devel] [PATCH] vhost-user spec: Clarify policy on setting log_base Victor Kaplansky
2017-11-28 16:04 ` Dr. David Alan Gilbert
2017-11-28 16:12   ` Michael S. Tsirkin
2017-11-28 17:38     ` Victor Kaplansky
2017-11-28 17:43       ` Dr. David Alan Gilbert
2017-11-28 18:17         ` Michael S. Tsirkin
2017-11-28 16:16 ` Michael S. Tsirkin
2017-11-28 17:29   ` Victor Kaplansky [this message]
2017-11-28 17:57     ` Michael S. Tsirkin
2017-11-28 17:43   ` Victor Kaplansky
2017-11-28 18:06 ` Michael S. Tsirkin
2017-11-28 18:34   ` Victor Kaplansky
2017-11-28 18:45     ` Michael S. Tsirkin
2017-11-28 20:55       ` Victor Kaplansky
2017-11-29  2:08   ` Jason Wang

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=1183103709.47097586.1511890144875.JavaMail.zimbra@redhat.com \
    --to=vkaplans@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.