Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935898AbcCQMhU (ORCPT ); Thu, 17 Mar 2016 08:37:20 -0400 Received: from imap.thunk.org ([74.207.234.97]:56292 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935462AbcCQMhN (ORCPT ); Thu, 17 Mar 2016 08:37:13 -0400 Date: Thu, 17 Mar 2016 08:36:47 -0400 From: "Theodore Ts'o" To: Gregory Farnum Cc: sandeen@redhat.com, Andreas Dilger , "Darrick J. Wong" , Dave Chinner , Linus Torvalds , Ric Wheeler , Andy Lutomirski , One Thousand Gnomes , Martin Petersen , Christoph Hellwig , Jens Axboe , Andrew Morton , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks Message-ID: <20160317123647.GI23593@thunk.org> Mail-Followup-To: Theodore Ts'o , Gregory Farnum , sandeen@redhat.com, Andreas Dilger , "Darrick J. Wong" , Dave Chinner , Linus Torvalds , Ric Wheeler , Andy Lutomirski , One Thousand Gnomes , Martin Petersen , Christoph Hellwig , Jens Axboe , Andrew Morton , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton References: <20160314144603.GO29218@thunk.org> <20160315201431.GG30721@dastard> <20160315223313.GH30721@dastard> <20160315225224.GD23848@thunk.org> <20160316015139.GC5826@birch.djwong.org> <7674C689-C07E-4D38-85EB-4FD9B55CBB35@dilger.ca> <20160317001502.GF23593@thunk.org> <56E9FB73.6040803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 21 On Wed, Mar 16, 2016 at 10:18:19PM -0700, Gregory Farnum wrote: > would've been nice if they were upstream. What *is* a big deal for > FileStore (and would be easy to take advantage of) is the thematically > similar O_NOMTIME flag, which is also about reducing metadata updates > and got blocked on similar stupid-user grounds (although not security > ones): http://thread.gmane.org/gmane.linux.kernel.api/10727. Try mounting with the lazytime mount option. That should give you the nearly all of the metaata update reduction for free. It is slightly better optimized for in ext4. but it should work for xfs and btrfs as well. The mtime will still get updated on disk about once a day (or if memory pressure pushes the inode out of memory or on an unmount), but the in-memory inode has the correct timestamps, so stat will return the correct mtime value and so the result is POSIX compliant for those people who still care such things. (Actually, if you need to pass POSIX conformance testing you should use strictatime,lazytime so that atime is updated when POSIX mandates it to be updated.) - Ted