From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Write atomicity guarantees Date: Thu, 24 Apr 2014 13:39:09 -0400 Message-ID: <20140424173909.GB5886@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: "Martin K. Petersen" , Theodore Ts'o , Dave Chinner , Chris Mason Return-path: Received: from mga02.intel.com ([134.134.136.20]:49271 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753862AbaDXRjM (ORCPT ); Thu, 24 Apr 2014 13:39:12 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: NVMe allows the drive to tell the host what atomicity guarantees it provides for a write command. At the moment, I don't think Linux has a way for the driver to pass that information up to the filesystem. The value that is most interesting to report is Atomic Write Unit Power Fail ("if you send a write no larger than this, the drive guarantees to write all of it or none of it"), minimum value 1 sector. [1] There's a proposal before the NVMe workgroup to add a boundary size/offset to modify AWUPF ("except if you cross this boundary, then AWUPF is not guaranteed"). Think RAID stripe crossing. So, three questions. Is there somewhere already to pass boundary information up to the filesystem? Can filesystems make use of a larger atomic write unit than a single sector? And, if the device is internally a RAID device, is knowing the boundary size/offset useful? [1] There is also Atomic Write Unit Normal ("if you send two writes, neither of which is larger than this, subsequent reads will get either one or the other, not a mixture of both"), which I don't think we care about because the page cache prevents us from sending two writes which overlap with each other.