From owner-freebsd-stable@FreeBSD.ORG Wed Aug 6 20:24:08 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581BB1065691; Wed, 6 Aug 2008 20:24:08 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2B19B8FC20; Wed, 6 Aug 2008 20:24:08 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.14.1/8.14.1) with ESMTP id m76KCmeF042749; Wed, 6 Aug 2008 13:12:48 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.14.1/8.13.4/Submit) id m76KCmaZ042748; Wed, 6 Aug 2008 13:12:48 -0700 (PDT) Date: Wed, 6 Aug 2008 13:12:48 -0700 (PDT) From: Matthew Dillon Message-Id: <200808062012.m76KCmaZ042748@apollo.backplane.com> To: Kris Kennaway References: <47713ee10808050839k5b258831x66bc52f70b2c355b@mail.gmail.com> <47713ee10808060013h10dd3f57ma5f45e69a322743a@mail.gmail.com> <4899F49C.1000609@FreeBSD.org> Cc: stable@freebsd.org Subject: Re: Max size of one swap slice 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: Wed, 06 Aug 2008 20:24:08 -0000 : :See : :http://www.freebsd.org/cgi/getmsg.cgi?fetch=540837+0+/usr/local/www/db/text/2008/freebsd-questions/20080706.freebsd-questions : :Kris Hmm. I see an issue that FreeBSD could correct to reduce wired memory use by the swap system. Your sys/blist.h has this: typedef u_int32_t u_daddr_t; /* unsigned disk address */ and your sys/types.h has this: typedef int64_t daddr_t; /* unsigned disk address */ sys/blist.h really assumes a 32 bit daddr_t. It's amazing the code even still works with daddr_t at 64 bits and u_daddr_t at 32 bits. Changing that whole mess in sys/blist.h to a different typedef name, say swblk_t (which is already defined to be 32 bits), and renaming u_daddr_t to u_swblk_t, plus also changing the swblock structure in vm/swap_pager.c to use a 32 bit array elements instead of 64 bit array elements will cut the size of struct swblock almost in half. There is no real need for swap block addressing > 32 bits. 32 bits gives you swap in the terrabyte range. struct swblock { struct swblock *swb_hnext; vm_object_t swb_object; vm_pindex_t swb_index; int swb_count; daddr_t swb_pages[SWAP_META_PAGES]; <<<<<<<<< this array }; Any arithmatic accessing the elements would also have to be vetted for any necessary promotions. -Matt Matthew Dillon