]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: introduce struct sctp_stream_out_ext
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tue, 3 Oct 2017 22:20:11 +0000 (19:20 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Oct 2017 23:27:28 +0000 (16:27 -0700)
commitebe85f5c144768937861c6f20c1b98b1749049f5
treece68d2060940a95d6a8657bc44d261d856668bd5
parent3abeb87ba09ad015b3bfc5f3b4fb2a64a9b53632
sctp: introduce struct sctp_stream_out_ext

With the stream schedulers, sctp_stream_out will become too big to be
allocated by kmalloc and as we need to allocate with BH disabled, we
cannot use __vmalloc in sctp_stream_init().

This patch moves out the stats from sctp_stream_out to
sctp_stream_out_ext, which will be allocated only when the application
tries to sendmsg something on it.

Just the introduction of sctp_stream_out_ext would already fix the issue
described above by splitting the allocation in two. Moving the stats
to it also reduces the pressure on the allocator as we will ask for less
memory atomically when creating the socket and we will use GFP_KERNEL
later.

Then, for stream schedulers, we will just use sctp_stream_out_ext.

Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/chunk.c
net/sctp/outqueue.c
net/sctp/socket.c
net/sctp/stream.c