]> git.baikalelectronics.ru Git - kernel.git/commit
net: implement per-cpu reserves for memory_allocated
authorEric Dumazet <edumazet@google.com>
Thu, 9 Jun 2022 06:34:09 +0000 (23:34 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 23:21:26 +0000 (16:21 -0700)
commit4f0f539e7ab03fcf80b73eb8539ef11fa5f5dcac
tree8e815ea9747b1e3e1a7ca89414f4f9f35f3bf185
parent808c05dfd3f588beaa5d4644d86c258ad4e38ee5
net: implement per-cpu reserves for memory_allocated

We plan keeping sk->sk_forward_alloc as small as possible
in future patches.

This means we are going to call sk_memory_allocated_add()
and sk_memory_allocated_sub() more often.

Implement a per-cpu cache of +1/-1 MB, to reduce number
of changes to sk->sk_prot->memory_allocated, which
would otherwise be cause of false sharing.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sock.h