]> git.baikalelectronics.ru Git - kernel.git/commit
tcp/dccp: add SLAB_DESTROY_BY_RCU flag for request sockets
authorEric Dumazet <edumazet@google.com>
Sat, 3 Oct 2015 13:27:28 +0000 (06:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Oct 2015 20:25:20 +0000 (13:25 -0700)
commit6966bfd88a13f63458e705529827c913c5f0b62e
treec3401c3053c26288e2bfef14544d326e9db3dc0d
parent95f93e38e97ceaed1c320f2bc69d26a726423ec5
tcp/dccp: add SLAB_DESTROY_BY_RCU flag for request sockets

Before letting request sockets being put in TCP/DCCP regular
ehash table, we need to add either :

- SLAB_DESTROY_BY_RCU flag to their kmem_cache
- add RCU grace period before freeing them.

Since we carefully respected the SLAB_DESTROY_BY_RCU protocol
like ESTABLISH and TIMEWAIT sockets, use it here.

req_prot_init() being only used by TCP and DCCP, I did not add
a new slab_flags into their rsk_prot, but reuse prot->slab_flags

Since all reqsk_alloc() users are correctly dealing with a failure,
add the __GFP_NOWARN flag to avoid traces under pressure.

Fixes: aaf9f4668c2b ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/request_sock.h
net/core/sock.c