Re: [PATCH nf-next] netfilter: flowtable: dedicated slab for flow entry
From: Florian Westphal
Date: Thu Jan 29 2026 - 05:29:44 EST
Qingfang Deng <dqfext@xxxxxxxxx> wrote:
> The size of `struct flow_offload` has grown beyond 256 bytes on 64-bit
> kernels (currently 280 bytes) because of the `flow_offload_tunnel`
> member added recently. So kmalloc() allocates from the kmalloc-512 slab,
> causing significant memory waste per entry.
>
> Introduce a dedicated slab cache for flow entries to reduce memory
> footprint. Results in a reduction from 512 bytes to 320 bytes per entry
> on x86_64 kernels.
Ok, but please use KMEM_CACHE(), we've had a bunch of patches
that removed kmem_cache_create() in several places, I would like
to avoid a followup patch.