Commit 2a441a9
netfilter: flowtable: dedicated slab for flow entry
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.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>1 parent 59ecffa commit 2a441a9
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
815 | 820 | | |
816 | 821 | | |
817 | | - | |
| 822 | + | |
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
| |||
830 | 835 | | |
831 | 836 | | |
832 | 837 | | |
| 838 | + | |
| 839 | + | |
833 | 840 | | |
834 | 841 | | |
835 | 842 | | |
836 | 843 | | |
837 | 844 | | |
838 | 845 | | |
839 | 846 | | |
| 847 | + | |
840 | 848 | | |
841 | 849 | | |
842 | 850 | | |
| |||
0 commit comments