Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 16:36:07 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: uk_slabsize, uk_ppera, uk_ipers, uk_pages
Message-ID:  <20140930123607.GE73266@glebius.int.ru>
In-Reply-To: <542A9EF0.3050405@FreeBSD.org>
References:  <542A916A.2060703@FreeBSD.org> <20140930114424.GD73266@glebius.int.ru> <542A9EF0.3050405@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140930123607.GE73266>