From owner-freebsd-fs@FreeBSD.ORG Thu Dec 5 02:31:32 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73F42C29; Thu, 5 Dec 2013 02:31:32 +0000 (UTC) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4051514AB; Thu, 5 Dec 2013 02:31:32 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id ma3so24734865pbc.40 for ; Wed, 04 Dec 2013 18:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=81phWmL6uO0MhTO5DF+UcR+zgCDgmhOHjfdr6UBP924=; b=v3Npxiga7o0gStbzjgnEykHqz1hOifICZ/EEPFwyfJYr3tk5H6UfoVJI3P17GvADnE zu+/wfWQ4LDPb3qhctZT3NfZJ0hnM2MLCKbCWxQI+2sYvhJE5x1G7NLTfFGhbEZrLb5B 6sw/bNX4SwyMnLbc65//MOxJ/8pQ4dngS1oHr4P4LOvYng/L8bVUicwTa7+owaV5IxWo YehPSb/aQ/9ND4RMjfgXl0Wx74LGdJEF6nd2xHAXDcpVowXEUCKEhXXklBPQVK+w/FEX mvG80KmC3a8hBN8amNzg0mxpRZCBl3knUoF7HtdEaE2YFp37WJYfCihw6+reUlkPUtNU GKIw== MIME-Version: 1.0 X-Received: by 10.68.190.33 with SMTP id gn1mr49902993pbc.48.1386210691924; Wed, 04 Dec 2013 18:31:31 -0800 (PST) Received: by 10.70.92.79 with HTTP; Wed, 4 Dec 2013 18:31:31 -0800 (PST) In-Reply-To: References: <1380880223590-5848720.post@n5.nabble.com> <524EEE40.5060208@gmail.com> <1381005634317-5849247.post@n5.nabble.com> <1386054141012-5865623.post@n5.nabble.com> Date: Wed, 4 Dec 2013 20:31:31 -0600 Message-ID: Subject: Re: Questions re swap-on-zfs From: Adam Vande More To: Ivailo.TANUSHEFF@raiffeisen.bg Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-fs , owner-freebsd-fs@freebsd.org, Beeblebrox X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Dec 2013 02:31:32 -0000 On Tue, Dec 3, 2013 at 1:58 AM, wrote: > Hello there :) > > I had similar issues with a test box (FreeBSD 9.1) I used few months ago > with not so much free RAM - the box had 1-3GB total RAM as far as I > remember. > After digging I have found that the problem was actually a swap deadlock > :) > What I mean: when you heavily utilize the system, for example building > ports or something, the system tries to swap some memory, used by the ZFS. > The problem is, that the swap is actually on the ZFS itself and uses the > same memory. > I am not sure I describe this precisely, but the overall result is that > the system uses more and more swap space just to be able to swap something > relatively small. It ends up crashing the system several times Well yes. When you put swap on ZFS under duress they are in contention for the same memory reserves. Since ZFS consumes memory thinking the kernel should be holding back whatever is needed for swap and swap thinks it's the last defense and guarded, you will run into problems using swap-on-ZFS. To put it in terms of a famous quote: I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. Such an issue can be programmed around, but you're still left with an abundance of memory contention issues. I suppose this is why Oracle and other ZFS devs have left this as 'unsupported'. A filesystem backed swap device is rarely a good idea. -- Adam