<br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 4:29 AM, Raghavendra Gowdappa <span dir="ltr">&lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Anand Avati&quot; &lt;<a href="mailto:aavati@redhat.com">aavati@redhat.com</a>&gt;<br>
&gt; To: &quot;Amar Tumballi&quot; &lt;<a href="mailto:atumball@redhat.com">atumball@redhat.com</a>&gt;<br>
&gt; Cc: <a href="mailto:bharata@linux.vnet.ibm.com">bharata@linux.vnet.ibm.com</a>, <a href="mailto:gluster-devel@nongnu.org">gluster-devel@nongnu.org</a>, &quot;Raghavendra Gowdappa&quot; &lt;<a href="mailto:rgowdapp@redhat.com">rgowdapp@redhat.com</a>&gt;<br>

&gt; Sent: Thursday, January 10, 2013 12:20:09 PM<br>
&gt; Subject: Re: [Gluster-devel] zero-copy readv<br>
&gt;<br>
&gt; On 01/09/2013 10:37 PM, Amar Tumballi wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; - On the read side things are a little more complicated. In<br>
&gt; &gt;&gt; rpc-transport/socket, there is a call to iobuf_get() to create a<br>
&gt; &gt;&gt; new<br>
&gt; &gt;&gt; iobuf for reading in the readv reply data from the server. We will<br>
&gt; &gt;&gt; need<br>
&gt; &gt;&gt; a framework changes where, if the readv request (of the xid for<br>
&gt; &gt;&gt; which<br>
&gt; &gt;&gt; readv reply is being handled) happened to be a &quot;direct&quot; variant<br>
&gt; &gt;&gt; (i.e,<br>
&gt; &gt;&gt; zero-copy), then the &quot;special iobuf around user&#39;s memory&quot; gets<br>
&gt; &gt;&gt; picked up<br>
&gt; &gt;&gt; and read() from socket is performed directly into user&#39;s memory.<br>
&gt; &gt;&gt; Similar, but equivalent, changes will have to be done in RDMA<br>
&gt; &gt;&gt; (Raghavendra on CC can help). Since the goal is to avoid memory<br>
&gt; &gt;&gt; copy,<br>
&gt; &gt;&gt; this data will be bypassing io-cache (and purging pre-cached data<br>
&gt; &gt;&gt; of<br>
&gt; &gt;&gt; those regions along the way).<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; On the read side too, our client protocol is designed to handle<br>
&gt; &gt; 0-copy<br>
&gt; &gt; already, ie, if the fop comes with an iobuf/iobref, then the same<br>
&gt; &gt; buffer<br>
&gt; &gt; is used for copying the received data from network.<br>
&gt; &gt; (client_submit_request() is designed to handle this). [1]<br>
&gt; &gt;<br>
&gt; &gt; We made all these changes to make RDMA 0-copy a possibility, so<br>
&gt; &gt; even<br>
&gt; &gt; RDMA transport should be already 0-copy friendly.<br>
&gt; &gt;<br>
&gt; &gt; Thats my understanding.<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Amar<br>
&gt; &gt;<br>
&gt; &gt; [1] - recent patches to handle RPC read-ahead may involve small<br>
&gt; &gt; data<br>
&gt; &gt; copy from header to data buffer, but surely not very high.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Amar - note that the current infrastructure present for 0-copy RDMA<br>
&gt; might not be sufficient for GFAPI&#39;s 0-copy. A glfs_readv() request<br>
&gt; from<br>
&gt; the app can come as a vector of memory pointers (and not a contiguous<br>
&gt; iobuf) and therefore require storing an iovec/count as well. This<br>
&gt; might<br>
&gt; also mean we need to exercise the scatter-gather aspects of the verbs<br>
&gt; API.<br>
<br>
</div></div>If we pass user supplied vectors as write chunks to server, it will do rdma-writes to memory regions pointed by those vectors. So, I think there are no major changes required to rdma as well.</blockquote><div>
<br></div><div>I wasn&#39;t sure if the client-side interface b/w protocol/client and rpc-transport/rdma was doing everything right even though the rdma transport itself had the capability. I guess that is probably what you mentioned as &quot;If we pass user supplied vectors..&quot;.</div>
<div><br></div><div>Avati</div></div>