All of lore.kernel.org
 help / color / mirror / Atom feed
* zero-copy recv ?
@ 2008-06-19 14:11 Peter T. Breuer
  2008-06-19 15:02 ` Frederik Deweerdt
  0 siblings, 1 reply; 5+ messages in thread
From: Peter T. Breuer @ 2008-06-19 14:11 UTC (permalink / raw)
  To: linux kernel

G'day all

I've been mmapping the request's bio buffers received on my block device
driver for userspace to use directly as tcp send/receive buffers.
However ...

  1) this works fantastically for (zero-copy) tcp send (i.e.
    from the address in user space that my mmap trick provides for the
    request buffers),
    
  2) tcp recv hangs.

What's going on? I'd be grateful for any clues as to how to fix this as
it's tcp zero-copy on recv when it goes OK!

What does tcp socket recv need exactly by way of an mmapped buffer?

Is there some set of flags that needs to be set on the pages that make
up the mmap?

Recv() hangs somewhere inside the tcp recv call inside kernel paths that
I cannot trace.  I see "recv(5, ...)" via strace.  The data is sent out
on the wire from the other side and apparently comes in, but the socket
tcp recv never progresses.

If, OTOH, I have previously written the device at that point, then
reading the device causes a request to appear at the device driver
with pages carrying the flags

    40001826

(referenced|error|lru|private|writeback)

and all works fantastically in the sense that recv called with those
pages mmapped into userspace as the recv buffer works just like it
should.

When the device has not been written at that point previously, then
I see pages appearing in the request bio buffers with pretty
random-looking flags, such as

    40020801

(locked|private|readahead)

and recv does its hang trick.

Does anyone have any insight as to what is going on?

Thanks


Peter


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: zero-copy recv ?
@ 2008-06-19 22:35 Peter T. Breuer
  2008-06-20  8:44 ` Peter T. Breuer
  0 siblings, 1 reply; 5+ messages in thread
From: Peter T. Breuer @ 2008-06-19 22:35 UTC (permalink / raw)
  To: linux kernel

References: <200806191411.m5JEBE56008942@betty.it.uc3m.es>

Gah .. I wrote an answer to this and it seems to have got lost. If you
saw the answer, please forward to me!

> On Thu, Jun 19, 2008 at 04:11:14PM +0200, Peter T. Breuer wrote:
> > I've been mmapping the request's bio buffers received on my block device
> > driver for userspace to use directly as tcp send/receive buffers.
> Is the code available somewhere by any chance?

It's just the daily development snapshot for the enbd driver: 

 ftp://oboe.it.uc3m.es/pub/Programs/enbd-2.4.36.tgz

and mirrors.

I wrote a quick summary of the relevant code in my lost answer :(.
Please ask me to repeat if it is really AWOL.


Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-06-20  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19 14:11 zero-copy recv ? Peter T. Breuer
2008-06-19 15:02 ` Frederik Deweerdt
2008-06-19 17:01   ` Peter T. Breuer
  -- strict thread matches above, loose matches on Subject: below --
2008-06-19 22:35 Peter T. Breuer
2008-06-20  8:44 ` Peter T. Breuer

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.