All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Andrzej Jakowski <andrzej.jakowski@linux.intel.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Haozhong Zhang <haozhong.zhang@intel.com>,
	qemu block <qemu-block@nongnu.org>,
	qemu-devel <qemu-devel@nongnu.org>, Max Reitz <mreitz@redhat.com>,
	Keith Busch <keith.busch@intel.com>,
	Zhang Yi <yi.z.zhang@linux.intel.com>,
	Junyan He <junyan.he@intel.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH v1] block/nvme: introduce PMR support from NVMe 1.4 spec
Date: Fri, 21 Feb 2020 17:31:16 +0000	[thread overview]
Message-ID: <CAJSP0QWXsZXBr_iVJp11FHYYj2Zb1NU62vA6kaR36mOH9B8abA@mail.gmail.com> (raw)
In-Reply-To: <e8aa39fd-b5eb-8ed2-445b-02cce3301748@linux.intel.com>

On Fri, Feb 21, 2020 at 3:36 PM Andrzej Jakowski
<andrzej.jakowski@linux.intel.com> wrote:
> On 2/21/20 6:45 AM, Stefan Hajnoczi wrote:
> > Why is msync(2) done on memory loads instead of stores?
>
> This is my interpretation of NVMe spec wording with regards to PMRWBM field
> which says:
>
> "The completion of a memory read from any Persistent
> Memory Region address ensures that all prior writes to the
> Persistent Memory Region have completed and are
> persistent."

Thanks, I haven't read the PMR section of the spec :).

A synchronous operation is bad for virtualization performance.  While
the sync may be a cheap operation in hardware, it can be arbitrarily
expensive with msync(2).  The vCPU will be stuck until msync(2)
completes on the host.

It's also a strange design choice since performance will suffer when
an unrelated read has to wait for writes to complete.  This is
especially problematic for multi-threaded applications or multi-core
systems where I guess this case is hit frequently.  Maybe it's so
cheap in hardware that it doesn't matter?  But then why didn't NVDIMM
use this mechanism?

If anyone knows the answer I'd be interested in learning.  But this
isn't a criticism of the patch - of course it needs to implement the
hardware spec and we can't change it.

Stefan


  reply	other threads:[~2020-02-21 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 22:48 [PATCH v1] block/nvme: introduce PMR support from NVMe 1.4 spec Andrzej Jakowski
2020-02-19  1:07 ` no-reply
2020-02-19 20:25   ` Andrzej Jakowski
2020-02-21 13:45 ` Stefan Hajnoczi
2020-02-21 15:36   ` Andrzej Jakowski
2020-02-21 17:31     ` Stefan Hajnoczi [this message]
2020-02-21 17:50       ` Dr. David Alan Gilbert
2020-02-21 18:29         ` Stefan Hajnoczi
2020-02-21 19:32       ` Stefan Hajnoczi
2020-02-21 20:20         ` Andrzej Jakowski
2020-02-21 18:45   ` Dr. David Alan Gilbert
2020-02-21 20:19     ` Andrzej Jakowski

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=CAJSP0QWXsZXBr_iVJp11FHYYj2Zb1NU62vA6kaR36mOH9B8abA@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=andrzej.jakowski@linux.intel.com \
    --cc=dgilbert@redhat.com \
    --cc=haozhong.zhang@intel.com \
    --cc=junyan.he@intel.com \
    --cc=keith.busch@intel.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yi.z.zhang@linux.intel.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 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.