mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Schwartz" <davids@webmaster.com>
To: "Krzysztof Halasa" <khc@pm.waw.pl>
Cc: <linux-kernel@vger.kernel.org>
Subject: RE: select for UNIX sockets?
Date: Tue, 10 Jun 2003 14:40:26 -0700	[thread overview]
Message-ID: <MDEHLPKNGKAHNMBLJOLKGEDDDJAA.davids@webmaster.com> (raw)
In-Reply-To: <m3isredh4e.fsf@defiant.pm.waw.pl>


> "David Schwartz" <davids@webmaster.com> writes:

> > For the last time, there is no socket queue. You wouldn't want there
> > to be
> > one.

> Sure. No queue. Of course.

	Yep.

> And these are only misleading names - net/unix/af_unix.c:
> static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
>                               struct msghdr *msg, int len)
> {
> ...
>
>        if (unix_peer(other) != sk &&
>             skb_queue_len(&other->receive_queue) >
> other->max_ack_backlog) {

	That looks like a *receive* queue to me. We were talking about selecting
for writes, weren't we.

> and then
>
>         skb_queue_tail(&other->receive_queue, skb);
>         unix_state_runlock(other);
>         other->data_ready(other, len);
>         sock_put(other);
>
> Right?

	Looks like another receive queue to me. There is no send queue and you
wouldn't want there to be one.

> > Consider a UDP application that is sending packets to two
> > destinations, one
> > over a 56Kbps serial link running PPP and one over gigabit Ethernet. If
> > there were a socket send queue, the packets going over the 56Kbps serial
> > link would block the packets going over the gigabit Ethernet.

> First, PPP and Ethernet use IP/UDP and not local UNIX sockets.
> Second, I hope you don't want to tell me PPP and Ethernet have no
> device queues, do you? Sure there are "virtual" devices with no queue,
> but that's another story.
> Have you checked what the above scenario would do? I guess the PPP would
> really limit the rate if you used only one socket.

	They have device queues, they have no socket send queues.

> Having no per-sender socket queue for UDP/IP is totally irrelevant here.

	It is relevent. Because when you select for write, you're trying to find
out whether there's space to write to the socket. That would require there
to be something for there to be space in or not to be space in. Whatever you
want to call that (I call it a 'socket send queue', but it doesn't matter)
that queue doesn't exist for UDP and you wouldn't want it to exist.

	With UDP, or any connectionless protocol, the application is ultimately
responsible for transmit pacing. You could argue that it would be nice if
the kernel helped out more than it currently does, but it has no obligation
to do so.

	DS



  parent reply	other threads:[~2003-06-10 21:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-06 12:20 MarKol
2003-06-07  0:14 ` David Schwartz
2003-06-08  0:04   ` Krzysztof Halasa
2003-06-09  3:11     ` David Schwartz
2003-06-09 17:18       ` Krzysztof Halasa
2003-06-09 17:55         ` David Schwartz
2003-06-09 22:24           ` Krzysztof Halasa
2003-06-10 13:34             ` Timothy Miller
2003-06-10 13:52               ` Richard B. Johnson
2003-06-10 14:21               ` Krzysztof Halasa
2003-06-10 19:04                 ` Jesse Pollard
2003-06-11 21:55                   ` Krzysztof Halasa
2003-06-11 22:50                     ` David Schwartz
2003-06-11 12:51                 ` Edgar Toernig
2003-06-10 21:40             ` David Schwartz [this message]
2003-06-11 22:04               ` Krzysztof Halasa
2003-06-09 23:45         ` James Stevenson
2003-06-08  4:15   ` Chris Friesen
2003-06-09  3:05     ` David Schwartz
2003-06-09 16:46   ` MarKol
2003-06-09 17:05     ` David Schwartz
  -- strict thread matches above, loose matches on Subject: below --
2003-06-04 12:19 Petr Vandrovec
2003-06-06  0:28 ` Valdis.Kletnieks
2003-06-06  0:38   ` Petr Vandrovec
2003-06-03  0:08 Krzysztof Halasa
2003-06-03 14:51 ` Alan Cox
2003-06-04 23:27   ` Krzysztof Halasa
2003-06-05 13:17     ` Krzysztof Halasa
2003-06-04 11:55 ` Jesse Pollard
2003-06-04 12:42   ` Krzysztof Halasa

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=MDEHLPKNGKAHNMBLJOLKGEDDDJAA.davids@webmaster.com \
    --to=davids@webmaster.com \
    --cc=khc@pm.waw.pl \
    --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

all inboxes | Powered by JetHome®