From owner-freebsd-stable@FreeBSD.ORG Tue Aug 23 07:30:42 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73393106564A for ; Tue, 23 Aug 2011 07:30:42 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7C48FC1B for ; Tue, 23 Aug 2011 07:30:41 +0000 (UTC) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 76B6B29041D; Tue, 23 Aug 2011 02:30:40 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh5.mail.rice.edu, auth channel Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id zTgIgcwvFW69; Tue, 23 Aug 2011 02:30:40 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh5.mail.rice.edu (Postfix) with ESMTPSA id 109FF29040A; Tue, 23 Aug 2011 02:30:39 -0500 (CDT) Message-ID: <4E53571F.2080701@rice.edu> Date: Tue, 23 Aug 2011 02:30:39 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.17) Gecko/20110620 Thunderbird/3.1.10 MIME-Version: 1.0 To: Matthew Dillon References: <4E4143A6.6030307@digsys.bg> <935F8EC2-88E0-45A3-BE8B-7210BE223BC5@mac.com> <4e42a0c0.e2t/9MF98O3HFjb1%perryh@pluto.rain.com> <4E4CCA6C.8020408@ipfw.ru> <20110820174147.GW17489@deviant.kiev.zoral.com.ua> <4E4FFAD3.4090706@rice.edu> <4E500014.6030800@ipfw.ru> <20110820191726.GY17489@deviant.kiev.zoral.com.ua> <201108230236.p7N2akxB040696@apollo.backplane.com> In-Reply-To: <201108230236.p7N2akxB040696@apollo.backplane.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: 32GB limit per swap device? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2011 07:30:42 -0000 On 08/22/2011 21:36, Matthew Dillon wrote: > The limitation was ONLY due to a *minor* 32-bit integer overflow in one > or two *intermediate* calculations in the radix tree code, which I > long ago fixed in DragonFly. > > Just find the changes in the DFly codebase and determine if they need > to be applied. > > The swap space radix code (which I wrote long ago) is in page-sized > blocks, so you actually probably want to keep using a 32-bit integer for > the block number there to keep the physical memory reservation required > for the radix tree low. If you just pop the base block id up to 64 bits > without adjusting the radix code to overlay a 64 bit bitmap on it you > waste a lot of physical memory for the same amount of swap reservation. Unfortunately, in FreeBSD, when daddr_t was increased to 64 bits a few years ago, the bitmap size was not increased. So, we have been wasting about half the space used by the blist structure for some time now. I expect that we'll fix this after the current code freeze ends. However, as Alexander observed, the primary reason for the 32GB limit on the size of a swap partition was artificial. The limit was being implemented in the wrong place. It was being performed before the conversion from 512 byte blocks to 4KB pages. Since a blist is managing swap space at the granularity of pages and the limit is imposed by the blist code, the check should come after the conversion. Just by moving the check to its proper place, the effective limit can be increased from 32GB to 256GB. Kostik committed such a change earlier today. Alan