Date: Wed, 6 Aug 2008 13:12:48 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Kris Kennaway <kris@freebsd.org> Cc: stable@freebsd.org Subject: Re: Max size of one swap slice Message-ID: <200808062012.m76KCmaZ042748@apollo.backplane.com> References: <47713ee10808050839k5b258831x66bc52f70b2c355b@mail.gmail.com> <B4738279-01FE-4AE2-9038-2E04A1BC3990@mac.com> <47713ee10808060013h10dd3f57ma5f45e69a322743a@mail.gmail.com> <4899F49C.1000609@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
: :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 <dillon@backplane.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808062012.m76KCmaZ042748>