[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180504093126.pxjqtehhzkwb6p46@gauss3.secunet.de>
Date: Fri, 4 May 2018 11:31:26 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Mathias Krause <minipli@...glemail.com>
CC: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: Re: [PATCH ipsec-next] xfrm: use a dedicated slab cache for struct
xfrm_state
On Thu, May 03, 2018 at 10:55:07AM +0200, Mathias Krause wrote:
> struct xfrm_state is rather large (768 bytes here) and therefore wastes
> quite a lot of memory as it falls into the kmalloc-1024 slab cache,
> leaving 256 bytes of unused memory per XFRM state object -- a net waste
> of 25%.
>
> Using a dedicated slab cache for struct xfrm_state reduces the level of
> internal fragmentation to a minimum.
>
> On my configuration SLUB chooses to create a slab cache covering 4
> pages holding 21 objects, resulting in an average memory waste of ~13
> bytes per object -- a net waste of only 1.6%.
>
> In my tests this led to memory savings of roughly 2.3MB for 10k XFRM
> states.
>
> Signed-off-by: Mathias Krause <minipli@...glemail.com>
Applied, thanks Mathias!
Powered by blists - more mailing lists