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
Unknown Object (File)
Wed, Aug 12, 10:39 PM
Unknown Object (File)
Wed, Aug 12, 12:14 PM
Unknown Object (File)
Wed, Aug 12, 11:49 AM
Unknown Object (File)
Wed, Aug 12, 11:46 AM
Unknown Object (File)
Wed, Aug 12, 11:18 AM
Unknown Object (File)
Tue, Jul 28, 11:56 AM
Unknown Object (File)
Sun, Jul 26, 2:30 PM
Unknown Object (File)
Jul 21 2026, 12:04 AM

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