From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 6 19:50:40 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6842A1065700; Tue, 6 Oct 2009 19:50:40 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 267EE8FC15; Tue, 6 Oct 2009 19:50:39 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n96JYbcd001437; Tue, 6 Oct 2009 15:34:37 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n96JYbl1001436; Tue, 6 Oct 2009 15:34:37 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 6 Oct 2009 15:34:37 -0400 From: David Schultz To: Anders Nordby , freebsd-hackers@FreeBSD.ORG, alc@FreeBSD.ORG, phk@FreeBSD.ORG Message-ID: <20091006193437.GA1196@zim.MIT.EDU> Mail-Followup-To: Anders Nordby , freebsd-hackers@freebsd.org, alc@FreeBSD.org, phk@FreeBSD.org References: <20091002202936.GA836@fupp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091002202936.GA836@fupp.net> Cc: Subject: Re: No end to swap zone exhausted problems? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 19:50:40 -0000 On Fri, Oct 02, 2009, Anders Nordby wrote: > Better post about my swap zone problems here than tear all my hair out. > This concerns me: > > 1) How can SWAPMETA usage continue increasing, while swap space used is > not? Example: http://anders.fupp.net/test/swapmeta.png. In the swap meta > graph, used space is USED and free space is LIMIT-USED (FREE numbers are > a bit odd, it starts with 0) from the SWAPMETA line when running vmstat > -z. In the week graph, you can see that after 3 days swap space usage > settles at around 90 GB, while swap meta keeps increasing. IIRC, the swap pager tracks virtual memory regions that include swapped pages on a granularity of 16 pages. An increase in swapmeta usage could simply mean that swap has become fragmented. It should eventually level out (unless there is actually a leak, but I think we'd know by now). > How come increasing maxswzone beyond 256 MB does not yield a larger > SWAPMETA than 995410? Does it stop around 260 MB maxswzone? How can I > increase SWAPMETA further to be able to swap more? The code appears to limit the number of swapmeta entries (each entry being about 100 bytes) to half the number of pages of physical memory you have (sys/vm/swap_pager.c): n = cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblock)) n = maxswzone / sizeof(struct swblock); You could try commenting out the first two of these lines, leaving the third, and see if that lets you raise the limit to something that works better for you. Note that raising it too high is also going to cause problems, as all of your physical memory will be filled with swap metadata.