Skip to content
Commit a4e9f8e3 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by David S. Miller
Browse files

wireguard: peer: allocate in kmem_cache

With deployments having upwards of 600k peers now, this somewhat heavy
structure could benefit from more fine-grained allocations.
Specifically, instead of using a 2048-byte slab for a 1544-byte object,
we can now use 1544-byte objects directly, thus saving almost 25%
per-peer, or with 600k peers, that's a savings of 303 MiB. This also
makes wireguard's memory usage more transparent in tools like slabtop
and /proc/slabinfo.

Fixes: 8b5553ac

 ("wireguard: queueing: get rid of per-peer ring buffers")
Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
Suggested-by: default avatarMatthew Wilcox <willy@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24b70eee
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment