From: swivel@shells.gnugeneration.com
To: David Miller <davem@davemloft.net>
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org
Subject: Re: Honoring SO_RCVLOWAT in proto_ops.poll methods
Date: Mon, 13 Oct 2008 03:32:14 -0500 [thread overview]
Message-ID: <20081013083214.GN2811@fc6222126.aspadmin.net> (raw)
In-Reply-To: <20081013.003441.109866647.davem@davemloft.net>
On Mon, Oct 13, 2008 at 12:34:41AM -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Sun, 05 Oct 2008 15:30:59 -0700 (PDT)
>
> > From: swivel@shells.gnugeneration.com
> > Date: Sun, 5 Oct 2008 16:45:57 -0500
> >
> > > I will be testing this patch today. At a glance it appears with this
> > > patch we're still not taking rcvlowat into consideration in recv()
> > > with MSG_PEEK flag set. This should probably also be corrected, as
> > > mentioned in the thread previously.
> >
> > Yes, I remember you mentioning that.
> >
> > I'll look into it.
>
> Were you able to test my updated patch?
>
> If it makes your application work, I might want to defer messing around
> with MSG_PEEK semantics in recvmsg().
>
> So I've been waiting for your test results before I proceed.
Didn't test your latest patch after you mentioned that you had tested it
yourself successfully.
The application is still broken having recv() not behave normally with
the MSG_PEEK flag. The app will spin calling recv() repeatedly once any
data has made it into the rcvbuf, because recv() will always immediately
return with the >0 # of bytes in the buffer.
I'm using the pseudo-blocking recv() behavior achieved with SO_RCVTIMEO.
Thus my app expects recv() to block until SO_RCVLOWAT is met or SO_RCVTIMEO
expired. Upon timeout expiration recv() is supposed to return -1 with
errno=EAGAIN. With recv() immediately returning on MSG_PEEK there's no
possibility for timeout expiration. recv() behaves perfectly in this
regard without MSG_PEEK, it just needs some minor adjustment to behave
the same with MSG_PEEK specified.
There's a simple diagram illustrating the application implementation
in general. This may help understand the implications of recv() not
blocking once there is data in the rcvbuf without wasting much of your
time:
http://serverkit.org/modules/httpx/httpx.png
Thanks for the follow-up.
Regards,
Vito Caputo
next prev parent reply other threads:[~2008-10-13 8:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-20 21:42 Honoring SO_RCVLOWAT in proto_ops.poll methods lkml
2008-09-20 22:21 ` David Miller
2008-09-20 23:00 ` lkml
2008-09-21 9:24 ` lkml
2008-09-21 14:18 ` Alan Cox
[not found] ` <20080921145134.GT2761@fc6222126.aspadmin.net>
2008-09-21 20:13 ` Alan Cox
2008-09-21 22:09 ` lkml
2008-10-05 20:27 ` David Miller
2008-10-05 21:45 ` swivel
2008-10-05 22:30 ` David Miller
2008-10-06 5:17 ` lkml
2008-10-06 17:18 ` David Miller
2008-10-06 17:45 ` David Miller
2008-10-13 7:34 ` David Miller
2008-10-13 8:32 ` swivel [this message]
2008-10-13 9:58 ` David Miller
2008-10-20 3:58 ` swivel
2008-10-20 4:25 ` David Miller
2008-11-05 11:36 ` David Miller
2008-09-22 12:15 ` David Miller
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=20081013083214.GN2811@fc6222126.aspadmin.net \
--to=swivel@shells.gnugeneration.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox