From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] fat: make discard a mount option Date: Wed, 18 Nov 2009 19:53:58 +0100 Message-ID: <20091118185358.GA29399@lst.de> References: <20091118170841.GA25541@lst.de> <87d43f4r1v.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org To: OGAWA Hirofumi Return-path: Received: from verein.lst.de ([213.95.11.210]:56319 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758242AbZKRSxz (ORCPT ); Wed, 18 Nov 2009 13:53:55 -0500 Content-Disposition: inline In-Reply-To: <87d43f4r1v.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Nov 19, 2009 at 03:38:04AM +0900, OGAWA Hirofumi wrote: > Christoph Hellwig writes: > > > Currently shipping discard capable SSDs and arrays have rather sub-optimal > > implementations of the command and can the use of it can cause massive > > slowdowns. Make issueing these commands option as it's already in btrfs > > and gfs2. > > Thanks. Looks good to me, I'll apply as is. > > BTW, what value is default for those users? And from users of some > filesystems, it might be better to do in lower layer or VFS? The situation is the following: As of 2.6.32-rc7: - btrfs needs the discard option to enable trim, it's off by default - gfs2 needs the discard option to enable trim, it's off by default - ext4 does discard by default, no option to disable - fat does discard by default, no option to disable - the swap code does discard by default, no option to disable Eric has a patch for ext4 to implement the btrfs/gfs2 semantics, and this is the one for fat. A discussion is ongoing about swap. I don't think moving block specific options is a good idea to do in the VFS. The other option would be to disable it in the block layer, but that's not alwas intuitive.