From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xenproject.org, qemu-devel@nongnu.org,
qemu-block@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
Kevin Wolf <kwolf@redhat.com>,
Paul Durrant <paul.durrant@citrix.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Max Reitz <mreitz@redhat.com>
Subject: [PATCH v2 1/3] xen-disk: only advertize feature-persistent if grant copy is not available
Date: Wed, 21 Jun 2017 08:52:47 -0400 [thread overview]
Message-ID: <20170621125249.8805-2-paul.durrant@citrix.com> (raw)
In-Reply-To: <20170621125249.8805-1-paul.durrant@citrix.com>
If grant copy is available then it will always be used in preference to
persistent maps. In this case feature-persistent should not be advertized
to the frontend, otherwise it may needlessly copy data into persistently
granted buffers.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
---
hw/block/xen_disk.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 3a22805fbc..9b06e3aa81 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1023,11 +1023,18 @@ static int blk_init(struct XenDevice *xendev)
blkdev->file_blk = BLOCK_SIZE;
+ blkdev->feature_grant_copy =
+ (xengnttab_grant_copy(blkdev->xendev.gnttabdev, 0, NULL) == 0);
+
+ xen_pv_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
+ blkdev->feature_grant_copy ? "enabled" : "disabled");
+
/* fill info
* blk_connect supplies sector-size and sectors
*/
xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1);
- xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
+ xenstore_write_be_int(&blkdev->xendev, "feature-persistent",
+ !blkdev->feature_grant_copy);
xenstore_write_be_int(&blkdev->xendev, "info", info);
blk_parse_discard(blkdev);
@@ -1202,12 +1209,6 @@ static int blk_connect(struct XenDevice *xendev)
xen_be_bind_evtchn(&blkdev->xendev);
- blkdev->feature_grant_copy =
- (xengnttab_grant_copy(blkdev->xendev.gnttabdev, 0, NULL) == 0);
-
- xen_pv_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
- blkdev->feature_grant_copy ? "enabled" : "disabled");
-
xen_pv_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
"remote port %d, local port %d\n",
blkdev->xendev.protocol, blkdev->ring_ref,
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-06-21 12:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 12:52 [PATCH v2 0/3] xen-disk: performance improvements Paul Durrant
2017-06-21 12:52 ` Paul Durrant [this message]
2017-06-22 0:40 ` [PATCH v2 1/3] xen-disk: only advertize feature-persistent if grant copy is not available Stefano Stabellini
2017-06-21 12:52 ` [PATCH v2 2/3] xen-disk: add support for multi-page shared rings Paul Durrant
2017-06-22 0:39 ` Stefano Stabellini
2017-06-21 12:52 ` [PATCH v2 3/3] xen-disk: use an IOThread per instance Paul Durrant
2017-06-22 22:14 ` Stefano Stabellini
[not found] ` <alpine.DEB.2.10.1706221410580.12819@sstabellini-ThinkPad-X260>
2017-07-07 8:20 ` Paul Durrant
[not found] ` <3b55bff7d41d4b37b52a8ec96d88677a@AMSPEX02CL01.citrite.net>
2017-07-07 22:06 ` Stefano Stabellini
[not found] ` <alpine.DEB.2.10.1707071452400.2919@sstabellini-ThinkPad-X260>
2017-07-10 12:11 ` Paul Durrant
2017-06-27 22:07 ` [PATCH v2 0/3] xen-disk: performance improvements Stefano Stabellini
2017-06-28 12:52 ` Paul Durrant
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=20170621125249.8805-2-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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).