netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Tom Herbert <tom@herbertland.com>
Cc: Florian Westphal <fw@strlen.de>,
	David Miller <davem@davemloft.net>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>,
	davejwatson@fb.com,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH net-next 0/6] kcm: Kernel Connection Multiplexor (KCM)
Date: Tue, 24 Nov 2015 23:22:42 +0100	[thread overview]
Message-ID: <20151124222242.GD23215@breakpoint.cc> (raw)
In-Reply-To: <CALx6S36oFH9=Px=pptZurWgS1MtFbhOE=FeK0jZmNBk3fU7tSg@mail.gmail.com>

Tom Herbert <tom@herbertland.com> wrote:
> On Tue, Nov 24, 2015 at 12:55 PM, Florian Westphal <fw@strlen.de> wrote:
> > Why anyone would invest such a huge amount of work in making this
> > kernel-based framing for single-stream tcp record (de)mux rather than
> > improving the userspace protocol to use UDP or SCTP or at least
> > one tcp connection per worker is beyond me.
> >
> From the /0 patch:
> 
> Q: Why not use an existing message-oriented protocol such as RUDP,
>    DCCP, SCTP, RDS, and others?
> 
> A: Because that would entail using a completely new transport protocol.

Thats why I wrote 'or at least one tcp connection per worker'.

> > For TX side, why is writev not good enough?
> 
> writev on a TCP stream does not guarantee atomicity of the operation.

Are you talking about short writes?

> It writes atomic without user space needing to implement locking when
> a socket is shared amongst threads.

Yes, I get that point, but I maintain that KCM is a strange workaround
for bad userspace design.

1 tcp connection per thread -> no userspace sockfd lock needed

Sender side can use writev, sendmsg, sendmmsg, etc to avoid sending
sub-record sized frames.

Is user space really so bad that instead of fixing it its simpler to
work around it with even more kernel bloat?

Since for KCM userspace has to be adjusted anyway I find that hard
to believe.

I don't know if the 'dynamic RCVLOWAT' that you want is needed
(you say 'yes', Eric reply seems to indicate its not (at least assuming
 a sane/friendly peer that doesn't intentionally xmit byte-by-byte).

But assuming there would really be a benefit, maybe a RCVLOWAT2 could
be added?  Of course we could only make it a hint and would have to
make a blocking read return with less data than desired when tcp rmem limit
gets hit.  But at least we'd avoid the 'unbounded allocation of large
amount of kernel memory' thing that we have with current proposal.

Thanks,
Florian

  reply	other threads:[~2015-11-24 22:22 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 21:21 [PATCH net-next 0/6] kcm: Kernel Connection Multiplexor (KCM) Tom Herbert
2015-11-20 21:21 ` [PATCH net-next 1/6] rcu: Add list_next_or_null_rcu Tom Herbert
2015-11-20 21:21 ` [PATCH net-next 2/6] net: Make sock_alloc exportable Tom Herbert
2015-11-20 21:21 ` [PATCH net-next 3/6] net: Add MSG_BATCH flag Tom Herbert
2015-11-23 10:02   ` Hannes Frederic Sowa
2015-11-20 21:21 ` [PATCH net-next 4/6] kcm: Kernel Connection Multiplexor module Tom Herbert
2015-11-20 22:50   ` Sowmini Varadhan
2015-11-20 23:19     ` Tom Herbert
2015-11-20 23:27       ` Sowmini Varadhan
2015-11-20 23:10   ` Alexei Starovoitov
2015-11-20 23:20     ` Tom Herbert
2015-11-23  9:42   ` Daniel Borkmann
2015-11-20 21:21 ` [PATCH net-next 5/6] kcm: Add statistics and proc interfaces Tom Herbert
2015-11-20 21:22 ` [PATCH net-next 6/6] kcm: Add description in Documentation Tom Herbert
2015-11-23  9:53 ` [PATCH net-next 0/6] kcm: Kernel Connection Multiplexor (KCM) Hannes Frederic Sowa
2015-11-23 12:43   ` Sowmini Varadhan
2015-11-23 17:33   ` Tom Herbert
2015-11-23 19:35     ` Hannes Frederic Sowa
2015-11-23 19:54     ` David Miller
2015-11-23 20:02       ` Tom Herbert
2015-11-24 11:25       ` Hannes Frederic Sowa
2015-11-24 15:49         ` David Miller
2015-11-24 15:27       ` Florian Westphal
2015-11-24 15:49         ` Eric Dumazet
2015-11-24 18:09           ` Rick Jones
2015-11-24 15:55         ` David Miller
2015-11-24 16:25           ` Florian Westphal
2015-11-24 17:00             ` Tom Herbert
2015-11-24 17:16               ` Florian Westphal
2015-11-24 17:43                 ` Tom Herbert
2015-11-24 20:55                   ` Florian Westphal
2015-11-24 21:49                     ` Tom Herbert
2015-11-24 22:22                       ` Florian Westphal [this message]
2015-11-24 22:25                         ` David Miller
2015-11-24 22:45                           ` Florian Westphal
2015-11-24 23:13                           ` Hannes Frederic Sowa
2015-11-24 18:23             ` Hannes Frederic Sowa
2015-11-24 18:59               ` Alexei Starovoitov
2015-11-24 19:16                 ` Hannes Frederic Sowa
2015-11-24 19:26                   ` Hannes Frederic Sowa
2015-11-24 20:23                   ` Alexei Starovoitov
     [not found]                     ` <1448402288.1489559.449199721.64EBB346@webmail.messagingengine.com>
     [not found]                       ` <20151124222109.GA86838@ast-mbp.thefacebook.com>
2015-11-25 10:38                         ` Hannes Frederic Sowa
2015-11-25 16:26             ` Sowmini Varadhan

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=20151124222242.GD23215@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=alexei.starovoitov@gmail.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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;
as well as URLs for NNTP newsgroup(s).