From owner-freebsd-fs@FreeBSD.ORG Tue Jul 7 07:21:55 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53C381065672 for ; Tue, 7 Jul 2009 07:21:55 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: from web37307.mail.mud.yahoo.com (web37307.mail.mud.yahoo.com [209.191.90.250]) by mx1.freebsd.org (Postfix) with SMTP id 135458FC16 for ; Tue, 7 Jul 2009 07:21:54 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: (qmail 91791 invoked by uid 60001); 7 Jul 2009 07:21:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1246951314; bh=I0MGwuVPDeCUYSdN0nzGFoe6NQcBFE0Hm+l05M4tdQY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZyxCbyYaWVw9H8N+/Q2oZiU65aj6wmJFHD4iGfY4B5ogm8w7ZgOQr92IfwUYv7CnhzB7GKZV4s4hIKTyOp7wGOqHU7hksL15Mh6n9ICQ1KJH0d7kTQlYJiuHnP+ccQ1PFN/0wVYfsksNUhHwf+XU6ILhE/wvHFXQPkS5Zw6rW9I= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ynRq+lP4g4bfac3vR68hUpsY2MysK/v2i+Jk3SfCpE+Kf017loh9hQ0bME0IZlzmm/+RxaCFpkt26RSjtt+A0qU9Ta3VzfzaoySzNYkoPIgOwOb33EoVIlTmAhTcGLT4S2BJO4bmR/Juo9ulkkQ3lwM59pginZ94IefgRSBHTAY=; Message-ID: <354003.91539.qm@web37307.mail.mud.yahoo.com> X-YMail-OSG: mbmqcT4VM1m0tbN8fUDWwBJC.gAga9nb4W6awjPdv7EUKzE2EwX.OWXcNwrNHMT659Du4gtiIFbl3ToHVuYxOz3gpcElJ2wBYBWknitIEfiWHb3rFnmli8bupIraY03HF7GXXdLlVokqlS__8GT2hKWYFgOsFVm2BT6oPpf.CVD89P1Cerk6kLEluqHrhjfa58hFEXuVKIL7l6mK667YbxLKKAH5qEX2U41kdDoYVwE7Z_9s7ZMK7OO3AAyyzvmvUT7ttEnubyB36UQNzoA11M3u5kV.yF6CX.VgPCqHLnRXbBcls8jytJOR Received: from [87.248.121.245] by web37307.mail.mud.yahoo.com via HTTP; Tue, 07 Jul 2009 00:21:54 PDT X-Mailer: YahooMailWebService/0.7.289.15 Date: Tue, 7 Jul 2009 00:21:54 -0700 (PDT) From: =?utf-8?B?xaBpbXVuIE1pa2VjaW4=?= To: Dan Naumov MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-fs@freebsd.org" Subject: Re: ZFS: swap on a ZVOL X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 07:21:55 -0000 Dan Naumov wrote:=0AAs far as I know, using swap on top of a "non-trivial" = filesystem like=0AZFS is considered "unsupported", but it does in fact work= . You can=0Acreate a ZVOL of arbitrary size (say, 4G) and then do the follo= wing:=0Azfs set org.freebsd:swap=3Don pool/swapvolname=0Ato have /etc/rc.d/= zfs enable swap on said ZVOL on every boot. You can=0Aalso do this in an ug= ly way: put swapon=0A/dev/zvol// into your /etc/rc.l= ocal (without=0Ahaving to pass the "org.freebsd:swap=3Don" option to the ZV= OL).=0A=0ANow the question remains, what kind of issues are expected to ari= se=0Awhen using swap on a ZVOL and is there any work going to in order to= =0Aresolve them? One of the issues mentioned is that ZVOL swap cannot=0Ahan= dle kernel dumps and another, more serious potential issue is a=0Arace cond= ition where "more swap is needed to swap". Assuming I have a=0Amachine with= 2gb ram, if I use a 4gb ZVOL swap, am I likely to run=0Ainto any serious i= ssues assuming that under normal operation, the=0Asystem uses from none to = very little swap?=0A=0AAFAIK, it was said that race condition you mentioned= also exists in OpenSolaris (that was back in the ZFS v6 days).=0ABut, AFAI= K new versions of OpenSolaris do use swap on ZFS volume as by default (corr= ect me if I'm wrong).=0ASomebody more knowledgeable should answer this, but= this made me thinking that maybe, just maybe that race condition was solve= d in some ZFS version >v6.=0A=0A=0A=0A=0A