From owner-freebsd-stable@FreeBSD.ORG Sat May 5 17:46:57 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 022D116A407 for ; Sat, 5 May 2007 17:46:57 +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 DE23713C447 for ; Sat, 5 May 2007 17:46:56 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.13.8/8.13.7) with ESMTP id l45HkuDd096771; Sat, 5 May 2007 10:46:56 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.13.8/8.13.4/Submit) id l45HkuUK096770; Sat, 5 May 2007 10:46:56 -0700 (PDT) Date: Sat, 5 May 2007 10:46:56 -0700 (PDT) From: Matthew Dillon Message-Id: <200705051746.l45HkuUK096770@apollo.backplane.com> To: John-Mark Gurney References: <5580F93A753EBAEF71B41EE7@ganymede.hub.org> <20070505160655.GA847@xor.obsecurity.org> <576837AA4FFCB91BF5B92A61@ganymede.hub.org> <20070505171806.GK17958@funkthat.com> Cc: pluknet , freebsd-stable@freebsd.org, "Marc G. Fournier" Subject: Re: swap zone exhausted, increase kern.maxswzone 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: Sat, 05 May 2007 17:46:57 -0000 Basically maxswzone is the amount of KVM the kernel is willing to use to store 'struct swblock' structures. These are the little structures that are stuck onto VM objects and specify which pages in the VM object(s) correspond to which pages of swap, for any swapped out data that no longer has a vm_page_t. It should be almost impossible to run out. Each structure can handle 16 contiguous swap block assignments in the VM object. Pages in VM objects tend to get swapped out in large linear swaths and the dynamic nature of paging tends to enforce this even if things are a bit chunky initially. So running out should just never happen. The only thing I can think of is if a machine has a tiny, tiny amount of ram and a huge amount of swap. e.g. like 64M of ram and 2G of swap, and actually tries to use it all. The default KVM reservation is based on physical memory, I think. Otherwise, it just shouldn't happen. I see that the code in FreeBSD is using UMA now, I would double check that it is actually calculating the proper amount of space allowed to be allocated. Maybe you have a leak somewhere. Note that swap interactions have to operate in low-memory situations. Make sure UMA isn't gonna have a meltdown if the system is running low on freeable VM pages. -Matt