From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH 3/5] block: Add support for DAX on block devices Date: Tue, 30 Jun 2015 15:56:15 -0400 Message-ID: <20150630195614.GG1971@linux.intel.com> References: <1435608152-6982-1-git-send-email-matthew.r.wilcox@intel.com> <1435608152-6982-4-git-send-email-matthew.r.wilcox@intel.com> <20150630111949.GA28508@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, Alexander Viro To: Christoph Hellwig Return-path: Received: from mga14.intel.com ([192.55.52.115]:11996 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751253AbbF3T4S (ORCPT ); Tue, 30 Jun 2015 15:56:18 -0400 Content-Disposition: inline In-Reply-To: <20150630111949.GA28508@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jun 30, 2015 at 04:19:49AM -0700, Christoph Hellwig wrote: > On Mon, Jun 29, 2015 at 04:02:30PM -0400, Matthew Wilcox wrote: > > From: Matthew Wilcox > > > > Without this patch, accesses to a file on a filesystem on a block device > > could be done without the page cache, but accessing the block device > > itself would always go through the page cache. > > > > Now reads and writes to a block device that is capable of DAX will always > > bypass the page cache. Loads and stores to an mmapped block device will > > bypass the page cache if the user specified O_DIRECT. This opt-in from > > the user is necessary because DAX mappings are currently incompatible > > with RDMA and O_DIRECT I/Os with non-DAX files. > > Using O_DIRECT for this seems like a pretty horrible hack, so I'd like > to see a really good justification of using this over other interfaces. O_DIRECT means "bypass the page cache", which is what this does (now it's able to apply to mmap too). > Also it needs a Cc to linux-api and an entry in the open man page, and > and even better explanation of why we only support this interface on > block devices but not file systems. Um, we do support this for filesystems with DAX. The inconsistency we have is that if you have a direct-access-capable block device, currently files in a filesystem on it get the bypass-page-cache treatment, but if you use the raw block device directly, that mapping doesn't. > Last but least I supect we'll need a runtime option for direct_access > support in the brd devices, as we're now going to use the regular > block device path less and less. I'm getting there; I was working on getting DAX to dynamically map the pages that it used (rather than relying on them being permanently part of the direct mapping), but I had to set that work aside temporarily. That lets us just delete the compile option, and have direct_access always work on brd.