From: Alexandre DERUMIER <aderumier@odiso.com>
To: jazeltq <jazeltq@gmail.com>
Cc: Tiger Hu <hufh2004@gmail.com>, Josh Durgin <jdurgin@redhat.com>,
Jeff Cody <jcody@redhat.com>, dillaman <dillaman@redhat.com>,
Kevin Wolf <kwolf@redhat.com>,
mreitz@redhat.com, qemu-block@nongnu.org,
qemu-devel <qemu-devel@nongnu.org>,
ceph-devel <ceph-devel@vger.kernel.org>,
tianqing <tianqing@unitedstack.com>
Subject: Re: [Qemu-devel] [RFC v5] RBD: Add support readv,writev for rbd
Date: Thu, 16 Feb 2017 16:13:41 +0100 (CET) [thread overview]
Message-ID: <887093105.8854266.1487258021988.JavaMail.zimbra@oxygem.tv> (raw)
In-Reply-To: <CAKZcxgfA6YvAOZfngyf0QC5iF1WwGK86DcXPJPwBOr_XFfzMuA@mail.gmail.com>
>>No yet. I just test on one qemu-kvm vm. It works fine.
>>The performance may need more time.
>>Any one can test on this patch if you do fast....
Hi, I would like to bench it with small 4k read/write.
On the ceph side,do we need this PR ? :
https://github.com/ceph/ceph/pull/13447
----- Mail original -----
De: "jazeltq" <jazeltq@gmail.com>
À: "Tiger Hu" <hufh2004@gmail.com>
Cc: "Josh Durgin" <jdurgin@redhat.com>, "Jeff Cody" <jcody@redhat.com>, "dillaman" <dillaman@redhat.com>, "Kevin Wolf" <kwolf@redhat.com>, mreitz@redhat.com, qemu-block@nongnu.org, "qemu-devel" <qemu-devel@nongnu.org>, "ceph-devel" <ceph-devel@vger.kernel.org>, "tianqing" <tianqing@unitedstack.com>
Envoyé: Jeudi 16 Février 2017 15:03:52
Objet: Re: [RFC v5] RBD: Add support readv,writev for rbd
No yet. I just test on one qemu-kvm vm. It works fine.
The performance may need more time.
Any one can test on this patch if you do fast....
2017-02-16 20:07 GMT+08:00 Tiger Hu <hufh2004@gmail.com>:
> Tianqing,
>
> Do we have any performance data for this patch? Thanks.
>
> Tiger
>> 在 2017年2月16日,下午5:00,jazeltq@gmail.com 写道:
>>
>> From: tianqing <tianqing@unitedstack.com>
>>
>> Rbd can do readv and writev directly, so wo do not need to transform
>> iov to buf or vice versa any more.
>>
>> Signed-off-by: tianqing <tianqing@unitedstack.com>
>> ---
>> block/rbd.c | 49 ++++++++++++++++++++++++++++++++++++++++++-------
>> 1 file changed, 42 insertions(+), 7 deletions(-)
>>
>> diff --git a/block/rbd.c b/block/rbd.c
>> index a57b3e3..75ae1d6 100644
>> --- a/block/rbd.c
>> +++ b/block/rbd.c
>> @@ -47,7 +47,7 @@
>> */
>>
>> /* rbd_aio_discard added in 0.1.2 */
>> -#if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 2)
>> +#if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(12, 0, 0)
>> #define LIBRBD_SUPPORTS_DISCARD
>> #else
>> #undef LIBRBD_SUPPORTS_DISCARD
>> @@ -73,7 +73,12 @@ typedef struct RBDAIOCB {
>> BlockAIOCB common;
>> int64_t ret;
>> QEMUIOVector *qiov;
>> +/* Note:
>> + * The LIBRBD_SUPPORTS_IOVEC is defined in librbd.h.
>> + */
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> char *bounce;
>> +#endif
>> RBDAIOCmd cmd;
>> int error;
>> struct BDRVRBDState *s;
>> @@ -83,7 +88,9 @@ typedef struct RADOSCB {
>> RBDAIOCB *acb;
>> struct BDRVRBDState *s;
>> int64_t size;
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> char *buf;
>> +#endif
>> int64_t ret;
>> } RADOSCB;
>>
>> @@ -426,11 +433,21 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
>> }
>> } else {
>> if (r < 0) {
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> memset(rcb->buf, 0, rcb->size);
>> +#else
>> + iov_memset(acb->qiov->iov, acb->qiov->niov, 0, 0, acb->qiov->size);
>> +#endif
>> acb->ret = r;
>> acb->error = 1;
>> } else if (r < rcb->size) {
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> memset(rcb->buf + r, 0, rcb->size - r);
>> +#else
>> + iov_memset(acb->qiov->iov, acb->qiov->niov,
>> + r, 0, acb->qiov->size - r);
>> +#endif
>> +
>> if (!acb->error) {
>> acb->ret = rcb->size;
>> }
>> @@ -441,10 +458,12 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
>>
>> g_free(rcb);
>>
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> if (acb->cmd == RBD_AIO_READ) {
>> qemu_iovec_from_buf(acb->qiov, 0, acb->bounce, acb->qiov->size);
>> }
>> qemu_vfree(acb->bounce);
>> +#endif
>> acb->common.cb(acb->common.opaque, (acb->ret > 0 ? 0 : acb->ret));
>>
>> qemu_aio_unref(acb);
>> @@ -655,8 +674,10 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
>> RBDAIOCB *acb;
>> RADOSCB *rcb = NULL;
>> rbd_completion_t c;
>> - char *buf;
>> int r;
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> + char *buf = NULL;
>> +#endif
>>
>> BDRVRBDState *s = bs->opaque;
>>
>> @@ -664,6 +685,8 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
>> acb->cmd = cmd;
>> acb->qiov = qiov;
>> assert(!qiov || qiov->size == size);
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> +
>> if (cmd == RBD_AIO_DISCARD || cmd == RBD_AIO_FLUSH) {
>> acb->bounce = NULL;
>> } else {
>> @@ -672,19 +695,21 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
>> goto failed;
>> }
>> }
>> - acb->ret = 0;
>> - acb->error = 0;
>> - acb->s = s;
>> -
>> if (cmd == RBD_AIO_WRITE) {
>> qemu_iovec_to_buf(acb->qiov, 0, acb->bounce, qiov->size);
>> }
>> -
>> buf = acb->bounce;
>> +#endif
>> + acb->ret = 0;
>> + acb->error = 0;
>> + acb->s = s;
>>
>> rcb = g_new(RADOSCB, 1);
>> +
>> rcb->acb = acb;
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> rcb->buf = buf;
>> +#endif
>> rcb->s = acb->s;
>> rcb->size = size;
>> r = rbd_aio_create_completion(rcb, (rbd_callback_t) rbd_finish_aiocb, &c);
>> @@ -694,10 +719,18 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
>>
>> switch (cmd) {
>> case RBD_AIO_WRITE:
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> r = rbd_aio_write(s->image, off, size, buf, c);
>> +#else
>> + r = rbd_aio_writev(s->image, qiov->iov, qiov->niov, off, c);
>> +#endif
>> break;
>> case RBD_AIO_READ:
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> r = rbd_aio_read(s->image, off, size, buf, c);
>> +#else
>> + r = rbd_aio_readv(s->image, qiov->iov, qiov->niov, off, c);
>> +#endif
>> break;
>> case RBD_AIO_DISCARD:
>> r = rbd_aio_discard_wrapper(s->image, off, size, c);
>> @@ -719,7 +752,9 @@ failed_completion:
>> rbd_aio_release(c);
>> failed:
>> g_free(rcb);
>> +#ifndef LIBRBD_SUPPORTS_IOVEC
>> qemu_vfree(acb->bounce);
>> +#endif
>> qemu_aio_unref(acb);
>> return NULL;
>> }
>> --
>> 2.10.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
谦谦君子
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-16 15:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-21 10:59 [Qemu-devel] [RFC v3] RBD: Add support readv,writev for rbd jazeltq
2017-01-21 11:13 ` no-reply
2017-01-21 13:19 ` [Qemu-devel] [RFC v4] " jazeltq
2017-02-16 8:43 ` jazeltq
2017-02-16 9:00 ` [Qemu-devel] [RFC v5] " jazeltq
2017-02-16 12:07 ` Tiger Hu
2017-02-16 14:03 ` Jaze Lee
2017-02-16 15:13 ` Alexandre DERUMIER [this message]
2017-02-16 15:26 ` Jason Dillaman
2017-02-16 14:14 ` Jason Dillaman
2017-02-16 14:22 ` Jaze Lee
2017-02-16 15:45 ` Eric Blake
2017-02-16 15:51 ` Jeff Cody
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=887093105.8854266.1487258021988.JavaMail.zimbra@oxygem.tv \
--to=aderumier@odiso.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dillaman@redhat.com \
--cc=hufh2004@gmail.com \
--cc=jazeltq@gmail.com \
--cc=jcody@redhat.com \
--cc=jdurgin@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=tianqing@unitedstack.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 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).