From: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
ian.jackson@eu.citrix.com, P.Gawkowski@ii.pw.edu.pl,
anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
roger.pau@citrix.com
Subject: Re: [PATCH v2 2/2] qdisk - hw/block/xen_disk: grant copy implementation
Date: Mon, 13 Jun 2016 12:44:27 +0200 [thread overview]
Message-ID: <1465814667.17840.11.camel@localhost> (raw)
In-Reply-To: <575E87C0.5030609@citrix.com>
On Mon, 2016-06-13 at 11:15 +0100, David Vrabel wrote:
> On 13/06/16 10:43, Paulina Szubarczyk wrote:
> > Copy data operated on during request from/to local buffers to/from
> > the grant references.
> >
> > Before grant copy operation local buffers must be allocated what is
> > done by calling ioreq_init_copy_buffers. For the 'read' operation,
> > first, the qemu device invokes the read operation on local buffers
> > and on the completion grant copy is called and buffers are freed.
> > For the 'write' operation grant copy is performed before invoking
> > write by qemu device.
> >
> > A new value 'feature_grant_copy' is added to recognize when the
> > grant copy operation is supported by a guest.
> > The body of the function 'ioreq_runio_qemu_aio' is moved to
> > 'ioreq_runio_qemu_aio_blk' and in the 'ioreq_runio_qemu_aio' depending
> > on the support for grant copy according checks, initialization, grant
> > operation are made, then the 'ioreq_runio_qemu_aio_blk' function is
> > called.
>
> I think you should add an option to force the use of grant mapping even
> if copy support is detected. If future changes to the grant map
> infrastructure makes it faster or if grant map scales better in some
> systems, then it would be useful to be able to use it.
The 'feature_grant_copy' is a boolean and could be set to false in such case.
There could be added a node in XenStore, for example
'feature-force-grant-map', which when set by frontend will be read
during a connection and changed the value to false forcing the grant map
operation.
> > + rc = xc_gnttab_grant_copy(gnt, count, segs);
> > +
> > + if (rc) {
> > + xen_be_printf(&ioreq->blkdev->xendev, 0,
> > + "failed to copy data %d \n", rc);
>
> I don't think you want to log anything here. A guest could spam the
> logs by repeatedly submitting requests with (for example) bad grant
> references.
I might removed that log or change the level, though when the mapping
fails for grant map it is logged in a similar manner.
> > + ioreq->aio_errors++;
> > + r = -1; goto out;
>
> return -1;
>
> > @@ -1020,10 +1163,18 @@ static int blk_connect(struct XenDevice *xendev)
> >
> > xen_be_bind_evtchn(&blkdev->xendev);
> >
> > + xc_gnttab_grant_copy_segment_t seg;
> > + blkdev->feature_grant_copy =
> > + (xc_gnttab_grant_copy(blkdev->xendev.gnttabdev, 0, &seg) == 0);
>
> You can pass NULL for the segments here.
Yes, thank you.
>
> > +
> > + xen_be_printf(&blkdev->xendev, 3, "GRANT COPY %s\n",
> > + blkdev->feature_grant_copy ? "ENABLED" : "DISABLED");
> > +
> > xen_be_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
> > "remote port %d, local port %d\n",
> > blkdev->xendev.protocol, blkdev->ring_ref,
> > blkdev->xendev.remote_port, blkdev->xendev.local_port);
> > +
> > return 0;
> > }
>
> David
>
Paulina
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-13 10:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 9:43 [PATCH v2 0/2] qemu-qdisk: Implementation of grant copy operation Paulina Szubarczyk
2016-06-13 9:43 ` [PATCH v2 1/2] libs, libxc: Interface for " Paulina Szubarczyk
2016-06-13 10:04 ` David Vrabel
2016-06-16 12:16 ` Wei Liu
2016-06-16 12:36 ` David Vrabel
2016-06-16 12:50 ` Wei Liu
2016-06-17 16:43 ` Wei Liu
2016-06-17 17:27 ` Paulina Szubarczyk
2016-06-13 9:43 ` [PATCH v2 2/2] qdisk - hw/block/xen_disk: grant copy implementation Paulina Szubarczyk
2016-06-13 10:15 ` David Vrabel
2016-06-13 10:44 ` Paulina Szubarczyk [this message]
2016-06-13 10:58 ` David Vrabel
2016-06-15 16:55 ` Paulina Szubarczyk
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=1465814667.17840.11.camel@localhost \
--to=paulinaszubarczyk@gmail.com \
--cc=P.Gawkowski@ii.pw.edu.pl \
--cc=anthony.perard@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wei.liu2@citrix.com \
--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 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.