Re: [PATCH net-next 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-04-26 Thread Oleg Babin
On 04/27/2018 01:28 AM, Marcelo Ricardo Leitner wrote: > On Fri, Apr 27, 2018 at 01:14:56AM +0300, Oleg Babin wrote: >> Hi Marcelo, >> >> On 04/24/2018 12:33 AM, Marcelo Ricardo Leitner wrote: >>> Hi, >>> >>> On Mon, Apr 23, 2018 at 09:41:04PM +03

Re: [PATCH net-next 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-04-26 Thread Oleg Babin
On 04/24/2018 12:33 AM, Marcelo Ricardo Leitner wrote: > On Mon, Apr 23, 2018 at 09:41:05PM +0300, Oleg Babin wrote: >> This patch introduces wrappers for accessing in/out streams indirectly. >> This will enable to replace physically contiguous memory arrays >> of streams wit

Re: [PATCH net-next 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-04-26 Thread Oleg Babin
Hi Marcelo, On 04/24/2018 12:33 AM, Marcelo Ricardo Leitner wrote: > Hi, > > On Mon, Apr 23, 2018 at 09:41:04PM +0300, Oleg Babin wrote: >> Each SCTP association can have up to 65535 input and output streams. >> For each stream type an array of sctp_stream_in or sctp_stream

[PATCH net-next 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-04-23 Thread Oleg Babin
This patch introduces wrappers for accessing in/out streams indirectly. This will enable to replace physically contiguous memory arrays of streams with flexible arrays (or maybe any other appropriate mechanism) which do memory allocation on a per-page basis. Signed-off-by: Oleg Babin

[PATCH net-next 2/2] net/sctp: Replace in/out stream arrays with flex_array

2018-04-23 Thread Oleg Babin
This path replaces physically contiguous memory arrays allocated using kmalloc_array() with flexible arrays. This enables to avoid memory allocation failures on the systems under a memory stress. Signed-off-by: Oleg Babin --- include/net/sctp/structs.h | 1 + net/sctp/stream.c | 78

[PATCH net-next 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-04-23 Thread Oleg Babin
native). * Second patch replaces kmalloc_array() with flex_array usage. Oleg Babin (2): net/sctp: Make wrappers for accessing in/out streams net/sctp: Replace in/out stream arrays with flex_array include/net/sctp/structs.h | 31 +--- net/sctp/chunk.c | 6 +- net/sctp/outq