From: Davide Libenzi <davidel@xmailserver.org>
To: Nagendra Tomar <tomer_iisc@yahoo.com>
Cc: netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH 2.6.23-rc6 Resending] NETWORKING : Edge Triggered EPOLLOUT events get missed for TCP sockets
Date: Thu, 20 Sep 2007 15:37:18 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0709201518540.8897@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <120313.72141.qm@web53705.mail.re2.yahoo.com>
On Thu, 20 Sep 2007, Nagendra Tomar wrote:
>
> --- Davide Libenzi <davidel@xmailserver.org> wrote:
>
> > Looking back at it, I think the current TCP code is right, once you look
> > at the "event" to be a output buffer full->with_space transition.
> > If you drop an fd inside epoll with EPOLLOUT|EPOLLET and you get an event
> > (free space on the output buffer), if you do not consume it (say a
> > tcp_sendmsg that re-fill the buffer), you can't see other OUT event
> > anymore since they happen on the full->with_space transition.
> > Yes, I know, the read size (EPOLLIN) works differently and you get an
> > event for every packet you receive. And yes, I do not like asymmetric
> > things. But that does not make the EPOLLOUT|EPOLLET wrong IMO.
> >
>
> I agree that ET means the event should happen at the transition
> from nospace->space condition, but isn't the other case (event is
> delivered every time the event actually happens) more usable.
> Also the epoll man page says so
>
> "... Edge Triggered event distribution delivers events only when
> events happens on the monitored file."
>
> This serves the purpose of ET (reducing the number of poll events) and
> at the same time makes userspace coding easier. My userspace code
> has the liberty of deciding when it can write to the socket. f.e. the
> sendfile buffer management example that I quoted in my earlier post
> will be difficult with the current ET|POLLOUT behaviour. I cannot
> write in full-buffer units. I'll ve to write partial buffers just to
> fill the TCP writeq which is needed to trigger the event.
That's not what POLLOUT means in the Unix meaning. POLLOUT indicates the
ability to write, and it is not meant as to signal every time a packet
(skb) is sent on the wire (and the buffer released).
In your particular application, you could simply split the sendfile into
appropriately sized chunks, and handle the buffer realease in there.
- Davide
next prev parent reply other threads:[~2007-09-20 22:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 22:37 Nagendra Tomar
2007-09-19 22:44 ` David Miller
2007-09-19 22:55 ` Nagendra Tomar
2007-09-19 23:10 ` David Miller
2007-09-19 23:32 ` Nagendra Tomar
2007-09-19 23:11 ` Davide Libenzi
2007-09-19 23:50 ` Nagendra Tomar
2007-09-20 5:43 ` Davide Libenzi
2007-09-20 6:11 ` Eric Dumazet
2007-09-20 8:02 ` Nagendra Tomar
2007-09-20 17:56 ` Davide Libenzi
2007-09-20 22:24 ` Nagendra Tomar
2007-09-20 17:42 ` Davide Libenzi
2007-09-20 22:09 ` Nagendra Tomar
2007-09-20 22:37 ` Davide Libenzi [this message]
2007-09-20 22:58 ` Nagendra Tomar
2007-09-21 17:45 ` Davide Libenzi
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=Pine.LNX.4.64.0709201518540.8897@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tomer_iisc@yahoo.com \
/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
all inboxes | Powered by JetHome®