diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2016-02-22 10:40:07 +0100 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2016-03-17 10:28:42 +0100 |
commit | 6ad3122a08e3a9c2148873665752e87cf4f393cc (patch) | |
tree | 95c89c906cbdf02f28c71bbfdc0513dfe1cdddae /include | |
parent | aac8d3c282e024c344c5b86dc1eab7af88bb9716 (diff) | |
download | linux-stable-6ad3122a08e3a9c2148873665752e87cf4f393cc.tar.gz linux-stable-6ad3122a08e3a9c2148873665752e87cf4f393cc.tar.bz2 linux-stable-6ad3122a08e3a9c2148873665752e87cf4f393cc.zip |
flowcache: Avoid OOM condition under preasure
We can hit an OOM condition if we are under presure because
we can not free the entries in gc_list fast enough. So add
a counter for the not yet freed entries in the gc_list and
refuse new allocations if the value is too high.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netns/xfrm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 730d82ad6ee5..24cd3949a9a4 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h @@ -80,6 +80,7 @@ struct netns_xfrm { struct flow_cache flow_cache_global; atomic_t flow_cache_genid; struct list_head flow_cache_gc_list; + atomic_t flow_cache_gc_count; spinlock_t flow_cache_gc_lock; struct work_struct flow_cache_gc_work; struct work_struct flow_cache_flush_work; |