From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 13:00:47 2010 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19192106566B for ; Thu, 29 Jul 2010 13:00:47 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF758FC27 for ; Thu, 29 Jul 2010 13:00:46 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3B41F.dip.t-dialin.net [87.179.180.31]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1CCC7844010; Thu, 29 Jul 2010 15:00:42 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id E53041F44; Thu, 29 Jul 2010 15:00:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1280408439; bh=z0ZQNwgUfjGzuopkJ0lQGrmA7ke1EX/v6oCkqkxhqMM=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=QN3UcFnpDO7TCltbYm5dLgIcga4mqMFb+Vd0jF951P9E/pqIaomlbEtaTBiq0RgNJ VsfVcixYuX6HK3TW5u5sI0sRNShf4Rri22rGk/SfnWfeqQ4RDVi6R15XeK1SwvFBBU wRI2PwnCdogepMPlAfxItEPFj3R9SWzec+NqpRGznyFP8fB0Bytx7nZhr5Ab9Y0tGm jK+52aDvEbjDfi1aen6vrcOzglQ7nAap9dpUaRiKESj2aZMpBnwnhh0yUyMPRxQi5f h2GJIoqyFp1tp32UB7KC24Dsctsi61pLOoBvyNca/AB6HMhjk0srSRJX001jGLSUj8 zniPiaIc8kKag== Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o6TD0cPO023165; Thu, 29 Jul 2010 15:00:38 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 29 Jul 2010 15:00:37 +0200 Message-ID: <20100729150037.88416rjfjpjj7fwo@webmail.leidinger.net> Date: Thu, 29 Jul 2010 15:00:37 +0200 From: Alexander Leidinger To: Andriy Gapon References: <20100729093158.86036msee9pbayw4@webmail.leidinger.net> <4C517436.7080509@icyb.net.ua> In-Reply-To: <4C517436.7080509@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 1CCC7844010.A2B38 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.1, required 6, autolearn=disabled, ALL_TRUSTED -1.00, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1281013243.46911@z3dnq9mBZA7j0wXnfEvrzQ X-EBL-Spam-Status: No Cc: fs@freebsd.org Subject: Re: arc cache: pagesize and/or power of 2 constraints? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 13:00:47 -0000 Quoting Andriy Gapon (from Thu, 29 Jul 2010 15:29:42 +0300): > on 29/07/2010 10:31 Alexander Leidinger said the following: >> Hi, >> >> while writting some acceptance tests for the Solaris machines at work I >> wondered if the size of the arc cache should be a multiple of the page >> size and/or a power of 2. I searched the net, but was not able to find >> some info regarding this. > > I suppose you mean ZFS ARC, not an ARC concept in general. Yes. > I wonder why you came at this question. > >> I would expect that it does not make sense to have an arc cache size >> which is not a multiple of the page size. > > Why? Does it make sense to allocate less than a memory page in the kernel? When I allocate in the same kernel-subsystem two times 1/4 of a memory page, can the allocations end up in the same memory page? If two independend subsystems try to do the same, can the allocations end up in the same page? >> And depending on how the arc >> cache is implemented, it would make sense to have it even as a power of >> 2 size (even if it is able to handle non-power-of-2 sizes). > > Why? If something is working on a binary tree of pages, you could end up in a case where you waste a page, if the size is not related to (2^n +/- x) * pagesize. Yes, this is bean-counting. >> Did someone had a look at this in FreeBSD? > > ARC size is almost arbitrary. > It's a collection of malloc/uma allocated buffers of various sizes, > individual > sizes are various multiples of 512. So it would make sense to set the size to n*512 (instead to e.g. n*512+x with 0 < x < 512)? Bye, Alexander. -- BOFH excuse #102: Power company testing new voltage spike (creation) equipment http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137