From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 30 12:36:11 2014 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2276DBC3; Tue, 30 Sep 2014 12:36:11 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 94D382F5; Tue, 30 Sep 2014 12:36:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8UCa7Kg074382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Sep 2014 16:36:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8UCa7pW074381; Tue, 30 Sep 2014 16:36:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 30 Sep 2014 16:36:07 +0400 From: Gleb Smirnoff To: Andriy Gapon Subject: Re: uk_slabsize, uk_ppera, uk_ipers, uk_pages Message-ID: <20140930123607.GE73266@glebius.int.ru> References: <542A916A.2060703@FreeBSD.org> <20140930114424.GD73266@glebius.int.ru> <542A9EF0.3050405@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <542A9EF0.3050405@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-hackers@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 12:36:11 -0000 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.