uk_slabsize, uk_ppera, uk_ipers, uk_pages
Gleb Smirnoff
glebius at FreeBSD.org
Tue Sep 30 12:36:11 UTC 2014
On Tue, Sep 30, 2014 at 03:15:44PM +0300, Andriy Gapon wrote:
A> This is not true for kegs with multi-page slabs. Consider a zone with 8KB items
A> on a system 4KB pages. Its keg uses slabs with the size of two pages, uk_ppera
A> is 2. There is only one item per slab, uk_ipers is 1. Let's say there are two
A> slabs allocated. Then uk_pages is 4. So, uk_ipers * uk_pages would give 4, but
A> in reality there are only two items. The correct calculation must be (uk_pages
A> / uk_ppera) * uk_ipers.
A>
A> If you have enough CPUs for a pcpu zone to use multi-page slabs / allocations,
A> then the above will also be applicable. Consider "64 pcpu" and 8 CPUs. You have
A> uk_ppera = 2, uk_ipers = 128. If there is only 1 "real" slab allocated that's 2
A> pages, so uk_pages * uk_ipers = 256, but in reality the correct number of
A> provided items is (uk_pages / uk_ppera) * uk_ipers = 128.
You are right.
--
Totus tuus, Glebius.
More information about the freebsd-hackers
mailing list