net: fix sk_mem_reclaim_partial()
authorEric Dumazet <edumazet@google.com>
Fri, 15 May 2015 19:39:25 +0000 (12:39 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:52 +0000 (02:18 +0000)
commit065d8e5a8975d0a576f0d1cb50108455e79f7c63
tree362b1e49fc664f4f5f037cd01484a5573f593105
parent093582b9b161c768f2038332d1cce5fbd696820e
net: fix sk_mem_reclaim_partial()

commit 1a24e04e4b50939daa3041682b38b82c896ca438 upstream.

sk_mem_reclaim_partial() goal is to ensure each socket has
one SK_MEM_QUANTUM forward allocation. This is needed both for
performance and better handling of memory pressure situations in
follow up patches.

SK_MEM_QUANTUM is currently a page, but might be reduced to 4096 bytes
as some arches have 64KB pages.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2:
 - Keep using atomic_long_sub() directly, not sk_memory_allocated_sub()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
include/net/sock.h
net/core/sock.c