Page MenuHomeFreeBSD

pf: Add a new zone for per-table entry counters.
ClosedPublic

Authored by markj on May 14 2020, 7:51 PM.
Tags
None
Referenced Files
F161386401: D24843.id.diff
Fri, Jul 3, 8:02 AM
F161384913: D24843.id71801.diff
Fri, Jul 3, 7:47 AM
Unknown Object (File)
Thu, Jul 2, 7:33 AM
Unknown Object (File)
May 11 2026, 12:51 AM
Unknown Object (File)
May 10 2026, 7:49 AM
Unknown Object (File)
May 9 2026, 6:04 PM
Unknown Object (File)
May 9 2026, 4:19 PM
Unknown Object (File)
May 9 2026, 3:30 PM

Details

Summary

Right now we allocate 2*PFR_OP_ADDR_MAX*OP_DIR_MAX counters per table
entry, which itself requires 8 pointers. We can instead define a zone
which returns arrays of 8 per-CPU counters, so the table entry structure
only needs to store one pointer.

On amd64 this reduces sizeof(pfr_kentry) from 216 to 160. The smaller
size also gets us better slab efficiency (i.e., there is less internal
fragmentation): we can pack 25 structures in a page instead of 18.
vm.uma.pf_table_entries.keg.efficiency goes from 94% to 97%.

Test Plan

pf regression tests pass

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable