From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: btrfs and swap files on SSD's ? Date: Mon, 19 Jan 2009 11:22:42 -0500 Message-ID: <1232382162.6521.108.camel@think.oraclecorp.com> References: <200901171110.22803.chris@csamuel.org> Mime-Version: 1.0 Content-Type: text/plain Cc: linux-btrfs To: Chris Samuel Return-path: In-Reply-To: <200901171110.22803.chris@csamuel.org> List-ID: On Sat, 2009-01-17 at 11:10 +1100, Chris Samuel wrote: > Hi folks, > > Someone on the OpenMoko community list commented recently about having created > a swap file on the SD card of their OpenMoko Neo phone and said that they'd > been lazy as they'd not made a swap partition. > > My thought was that with an SSD aware filesystem like btrfs a swapfile would > actually be a smarter move than a swap partition because it lets the > filesystem try and even the wear generated by access to it which a swap > partition will not have the freedom to do. It has actually been a while since I read through the swap-on-file code, but setup_swap_extents() makes me think it is making its own map of the blocks in use by the FS. This doesn't quite play nicely with btrfs and should lead to all kinds of problems....I'm looking into how to disable swapfiles completely. > > To me that makes logical sense but given the complexity of the kernel and > btrfs is it a fair comment to make and, also, would that be the case with > btrfs at present ? In general, the btrfs cow will be more wear leveling friendly but this is the kind of thing that I'd expect the ssd to do for us ;) -chris