<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/request_sock.c, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-10-05T10:19:06Z</updated>
<entry>
<title>tcp: restore fastopen operations</title>
<updated>2015-10-05T10:19:06Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-09-30T13:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac8cfc7bb836835bd68c3ab9da242747e9df9542'/>
<id>urn:sha1:ac8cfc7bb836835bd68c3ab9da242747e9df9542</id>
<content type='text'>
I accidentally cleared fastopenq.max_qlen in reqsk_queue_alloc()
while max_qlen can be set before listen() is called,
using TCP_FASTOPEN socket option for example.

Fixes: 0536fcc039a8 ("tcp: prepare fastopen code for upcoming listener changes")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: remove max_qlen_log</title>
<updated>2015-10-03T11:32:44Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef547f2ac16bd9d77a780a0e7c70857e69e8f23f'/>
<id>urn:sha1:ef547f2ac16bd9d77a780a0e7c70857e69e8f23f</id>
<content type='text'>
This control variable was set at first listen(fd, backlog)
call, but not updated if application tried to increase or decrease
backlog. It made sense at the time listener had a non resizeable
hash table.

Also rounding to powers of two was not very friendly.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp/dccp: remove struct listen_sock</title>
<updated>2015-10-03T11:32:43Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10cbc8f179177c1a6d5f56a46ebddc8f602ce5ac'/>
<id>urn:sha1:10cbc8f179177c1a6d5f56a46ebddc8f602ce5ac</id>
<content type='text'>
It is enough to check listener sk_state, no need for an extra
condition.

max_qlen_log can be moved into struct request_sock_queue

We can remove syn_wait_lock and the alignment it enforced.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp/dccp: shrink struct listen_sock</title>
<updated>2015-10-03T11:32:42Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81b496b31a4331415b6a644b485a329ec0b45155'/>
<id>urn:sha1:81b496b31a4331415b6a644b485a329ec0b45155</id>
<content type='text'>
We no longer use hash_rnd, nr_table_entries and syn_table[]

For a listener with a backlog of 10 millions sockets, this
saves 80 MBytes of vmalloced memory.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp/dccp: install syn_recv requests into ehash table</title>
<updated>2015-10-03T11:32:41Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=079096f103faca2dd87342cca6f23d4b34da8871'/>
<id>urn:sha1:079096f103faca2dd87342cca6f23d4b34da8871</id>
<content type='text'>
In this patch, we insert request sockets into TCP/DCCP
regular ehash table (where ESTABLISHED and TIMEWAIT sockets
are) instead of using the per listener hash table.

ACK packets find SYN_RECV pseudo sockets without having
to find and lock the listener.

In nominal conditions, this halves pressure on listener lock.

Note that this will allow for SO_REUSEPORT refinements,
so that we can select a listener using cpu/numa affinities instead
of the prior 'consistent hash', since only SYN packets will
apply this selection logic.

We will shrink listen_sock in the following patch to ease
code review.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Ying Cai &lt;ycai@google.com&gt;
Cc: Willem de Bruijn &lt;willemb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: move qlen/young out of struct listen_sock</title>
<updated>2015-10-03T11:32:36Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aac065c50aba0c534a929aeb687eb68c58e523b8'/>
<id>urn:sha1:aac065c50aba0c534a929aeb687eb68c58e523b8</id>
<content type='text'>
qlen_inc &amp; young_inc were protected by listener lock,
while qlen_dec &amp; young_dec were atomic fields.

Everything needs to be atomic for upcoming lockless listener.

Also move qlen/young in request_sock_queue as we'll get rid
of struct listen_sock eventually.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: add a spinlock to protect struct request_sock_queue</title>
<updated>2015-10-03T11:32:36Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-10-02T18:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fff1f3001cc58b5064a0f1154a7ac09b76f29c44'/>
<id>urn:sha1:fff1f3001cc58b5064a0f1154a7ac09b76f29c44</id>
<content type='text'>
struct request_sock_queue fields are currently protected
by the listener 'lock' (not a real spinlock)

We need to add a private spinlock instead, so that softirq handlers
creating children do not have to worry with backlog notion
that the listener 'lock' carries.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: prepare fastopen code for upcoming listener changes</title>
<updated>2015-09-29T23:53:10Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-09-29T14:42:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0536fcc039a8926ec12ec587f41a83f7acafeb82'/>
<id>urn:sha1:0536fcc039a8926ec12ec587f41a83f7acafeb82</id>
<content type='text'>
While auditing TCP stack for upcoming 'lockless' listener changes,
I found I had to change fastopen_init_queue() to properly init the object
before publishing it.

Otherwise an other cpu could try to lock the spinlock before it gets
properly initialized.

Instead of adding appropriate barriers, just remove dynamic memory
allocations :
- Structure is 28 bytes on 64bit arches. Using additional 8 bytes
  for holding a pointer seems overkill.
- Two listeners can share same cache line and performance would suffer.

If we really want to save few bytes, we would instead dynamically allocate
whole struct request_sock_queue in the future.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>inet: fix races with reqsk timers</title>
<updated>2015-08-11T04:17:29Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-08-10T16:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2235f2ac75fd2501c251b0b699a9632e80239a6d'/>
<id>urn:sha1:2235f2ac75fd2501c251b0b699a9632e80239a6d</id>
<content type='text'>
reqsk_queue_destroy() and reqsk_queue_unlink() should use
del_timer_sync() instead of del_timer() before calling reqsk_put(),
otherwise we could free a req still used by another cpu.

But before doing so, reqsk_queue_destroy() must release syn_wait_lock
spinlock or risk a dead lock, as reqsk_timer_handler() might
need to take this same spinlock from reqsk_queue_unlink() (called from
inet_csk_reqsk_queue_drop())

Fixes: fa76ce7328b2 ("inet: get rid of central tcp/dccp listener timer")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: convert syn_wait_lock to a spinlock</title>
<updated>2015-03-23T20:52:26Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-03-22T17:22:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b282705336e03fc7b9377a278939594870a40f96'/>
<id>urn:sha1:b282705336e03fc7b9377a278939594870a40f96</id>
<content type='text'>
This is a low hanging fruit, as we'll get rid of syn_wait_lock eventually.

We hold syn_wait_lock for such small sections, that it makes no sense to use
a read/write lock. A spin lock is simply faster.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
