flowcache: Increase threshold for refusing new allocations
authorMiroslav Urbanek <mu@miroslavurbanek.com>
Mon, 21 Nov 2016 14:48:21 +0000 (15:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Dec 2016 18:09:44 +0000 (19:09 +0100)
commitbe5339492b2919a910bf06630a861d5da8a478bd
tree9a016960bc5acdc055768f5395db451ae2391f07
parent3a116fa8c95d4c16f864475c4fdd395fd2a6cce4
flowcache: Increase threshold for refusing new allocations

commit 6b226487815574193c1da864f2eac274781a2b0c upstream.

The threshold for OOM protection is too small for systems with large
number of CPUs. Applications report ENOBUFs on connect() every 10
minutes.

The problem is that the variable net->xfrm.flow_cache_gc_count is a
global counter while the variable fc->high_watermark is a per-CPU
constant. Take the number of CPUs into account as well.

Fixes: 6ad3122a08e3 ("flowcache: Avoid OOM condition under preasure")
Reported-by: Lukáš Koldrt <lk@excello.cz>
Tested-by: Jan Hejl <jh@excello.cz>
Signed-off-by: Miroslav Urbanek <mu@miroslavurbanek.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/flow.c