[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimWf4kyi4HJFToXP=HH==hQgObQsHYyRfrSe0FS@mail.gmail.com>
Date: Tue, 29 Mar 2011 10:00:11 +0800
From: Changli Gao <xiaosuo@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Viral Mehta <Viral.Mehta@...infotech.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: zero copy for relay server
On Tue, Mar 29, 2011 at 2:34 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le lundi 28 mars 2011 à 23:48 +0530, Viral Mehta a écrit :
>
>> Still, these are two system calls.
>
> Yes. Is it a problem ? What kind ?
I think he concerns the overhead of system calls. In order to omit a
system call, I think you can implement sth. like this:
splice2(infd, outfd, pipefd, ...)
What you need do is maintaining pipes by yourself.
>> 2. I believe underlying PIPE that we are using will also have some size limit
>> (like in user space 4K or 64K, not sure)
>
> What kind of socket is able to deliver more than 64K frames ?
You can enlarge the size with fcntl(pipefd, F_SETPIPE_SZ,...).
>
>>
>> So, all in all
>> Why cant we have just one system call which really transfers "length"
>> bytes of data form one socket to another ? Recv "length" bytes of data
>> from socket A and send to socket B.
>>
>> I wanted to understand if there are any limitations or concerns that we still do
>> not have any such system call .... ?
>>
>
> The answer is : Once you try to implement this, you'll discover it'll be
> splice() based, using pipe as a buffer between the sockets.
Yes, but I think the internal buffer of pipe is pages, and it limits
its use in socket context. See skb_splice_bits(), and I am afraid copy
usually happens. Maybe the buffer of pipe should be any data but with
proper tear down functions.
>
> sendfile() is based on top of splice(), but it's faster to use splice().
>
>
Why? Thanks.
--
Regards,
Changli Gao(xiaosuo@...il.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists