From: Mike Christie <mchristi@redhat.com>
To: Alex Elder <elder@ieee.org>,
ceph-devel@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH 01/18] libceph: add scatterlist messenger data type
Date: Wed, 29 Jul 2015 12:49:30 -0500 [thread overview]
Message-ID: <55B9122A.704@redhat.com> (raw)
In-Reply-To: <55B8D677.8040800@ieee.org>
On 07/29/2015 08:34 AM, Alex Elder wrote:
> On 07/29/2015 04:23 AM, mchristi@redhat.com wrote:
>> From: Mike Christie <michaelc@cs.wisc.edu>
>>
>> LIO uses scatterlist for its page/data management. This patch
>> adds a scatterlist messenger data type, so LIO can pass its sg
>> down directly to rbd.
>>
>> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>
> I'm not going to be able to review all of these, and this
> isnt' even a complete review. But it's something...
No problem. Thanks for any comments.
>
> You're clearly on the right track, but I want to provide
> a meaningful review for correctness and design so I'm
> looking for a bit more information.
>
>> ---
>> include/linux/ceph/messenger.h | 13 ++++++
>> include/linux/ceph/osd_client.h | 12 +++++-
>> net/ceph/messenger.c | 96 +++++++++++++++++++++++++++++++++++++++++
>> net/ceph/osd_client.c | 26 +++++++++++
>> 4 files changed, 146 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
>> index 3775327..bc1bde8 100644
>> --- a/include/linux/ceph/messenger.h
>> +++ b/include/linux/ceph/messenger.h
>> @@ -79,6 +79,7 @@ enum ceph_msg_data_type {
>> #ifdef CONFIG_BLOCK
>> CEPH_MSG_DATA_BIO, /* data source/destination is a bio list */
>> #endif /* CONFIG_BLOCK */
>> + CEPH_MSG_DATA_SG, /* data source/destination is a scatterlist */
>> };
>>
>> static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type)
>> @@ -90,6 +91,7 @@ static __inline__ bool ceph_msg_data_type_valid(enum ceph_msg_data_type type)
>> #ifdef CONFIG_BLOCK
>> case CEPH_MSG_DATA_BIO:
>> #endif /* CONFIG_BLOCK */
>> + case CEPH_MSG_DATA_SG:
>> return true;
>> default:
>> return false;
>> @@ -112,6 +114,11 @@ struct ceph_msg_data {
>> unsigned int alignment; /* first page */
>> };
>> struct ceph_pagelist *pagelist;
>> + struct {
>> + struct scatterlist *sgl;
>> + unsigned int sgl_init_offset;
>> + u64 sgl_length;
>> + };
>
> Can you supply a short explanation of what these fields
> represent? It seems sgl_init_offset is the offset of the
> starting byte in the sgl, but is the purpose of that for
> page offset calculation, or does it represent an offset
> into the total length of the sgl? Or put another way,
> does sgl_init_offset represent some portion of the
> sgl_length that has been consumed already (and so the
> initial ressidual length is sgl_length - sgl_init_offset)?
sgl - starting scatterlist entry we are going to send/receive to/from.
sgl_init_offset - byte offset in the sgl above we will start executing
from. It is for cases like where a LIO command crossed segment/object
boundaries, so we had to break it up, and the first obj request ended up
in the middle of a scatterlist entry. For the second obj request we set
the sgl to the sg we ended on in the first request, and then set the
sgl_init_offset to where we left off in the first request.
So it basically allows me to not have to clone the list similar to how
the bio code does it. However, if we did clone it then I could just
manipulate the cloned sg's sg->offset instead of adding the
sgl_init_offset field.
sgl_length - number of bytes in the sgl we are going to send/receive.
This also is for the case where we broke up the LIO command into
multiple obj requests.
>
>> };
>> };
>>
>> @@ -139,6 +146,10 @@ struct ceph_msg_data_cursor {
>> struct page *page; /* page from list */
>> size_t offset; /* bytes from list */
>> };
>> + struct {
>> + struct scatterlist *sg; /* curr sg */
>
> /* current sg */
>
>> + unsigned int sg_consumed;
>
> Here too, what does sg_consumed represent with respect to the
> initial offset and the length?
It the number of bytes in the sgl we have sent/received. It is used by
the messenger advance code to track if we need to advance to the next sg
or if we still have data left from the current one.
next prev parent reply other threads:[~2015-07-29 17:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 9:23 [PATCH 01/18] libceph: add scatterlist messenger data type mchristi
2015-07-29 9:23 ` [PATCH 02/18] rbd: add support for scatterlist obj_request_type mchristi
2015-07-29 9:23 ` [PATCH 03/18] rbd: add lio specific data area mchristi
2015-07-29 9:23 ` [PATCH 04/18] libceph: support bidirectional requests mchristi
2015-11-21 23:32 ` Goldwyn Rodrigues
2015-07-29 9:23 ` [PATCH 05/18] libceph: add support for CMPEXT compare extent requests mchristi
2015-07-29 9:23 ` [PATCH 06/18] rbd: add write test helper mchristi
2015-07-29 9:23 ` [PATCH 07/18] rbd: add num ops calculator helper mchristi
2015-07-29 9:23 ` [PATCH 08/18] rbd: add support for COMPARE_AND_WRITE/CMPEXT mchristi
2015-07-29 9:23 ` [PATCH 09/18] libceph: add support for write same requests mchristi
2015-07-29 9:23 ` [PATCH 10/18] rbd: add support for writesame requests mchristi
2015-07-29 9:23 ` [PATCH 11/18] target: add compare and write callback mchristi
2015-07-29 9:23 ` [PATCH 12/18] target: compare and write backend driver sense handling mchristi
2015-09-04 19:41 ` Mike Christie
2015-09-04 22:34 ` Andy Grover
2015-09-06 6:38 ` Sagi Grimberg
2015-09-06 7:12 ` Christoph Hellwig
2015-07-29 9:23 ` [PATCH 13/18] target: add COMPARE_AND_WRITE sg creation helper mchristi
2015-07-29 9:23 ` [PATCH 14/18] libceph: fix pr_fmt compile issues mchristi
2015-07-29 9:23 ` [PATCH 15/18] rbd: export some functions used by lio rbd backend mchristi
2015-07-29 9:23 ` [PATCH 16/18] rbd: move structs used by lio rbd to new header mchristi
2015-07-29 9:23 ` [PATCH 17/18] target: add rbd backend mchristi
2015-07-29 14:27 ` Bart Van Assche
2015-07-29 17:07 ` Mike Christie
2015-07-29 9:23 ` [PATCH 18/18] target: add lio rbd to makefile/Kconfig mchristi
2015-07-29 13:34 ` [PATCH 01/18] libceph: add scatterlist messenger data type Alex Elder
2015-07-29 17:49 ` Mike Christie [this message]
2015-07-29 17:55 ` Christoph Hellwig
2015-07-29 22:59 ` Mike Christie
2015-07-29 23:40 ` Mike Christie
2015-07-30 7:34 ` Nicholas A. Bellinger
2015-07-30 14:55 ` Christoph Hellwig
2016-02-04 10:33 ` David Disseldorp
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=55B9122A.704@redhat.com \
--to=mchristi@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@ieee.org \
--cc=target-devel@vger.kernel.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.