Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031152AbdIZSL6 (ORCPT ); Tue, 26 Sep 2017 14:11:58 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:50712 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030942AbdIZSL4 (ORCPT ); Tue, 26 Sep 2017 14:11:56 -0400 X-Google-Smtp-Source: AOwi7QAklMy5e4gIoLAHu9iNighTgw7t9PXHviUnSspQJOZgwLPOJBVT0l+6In2F+TS7kp/v73QYNfZrGpfHVekL23A= MIME-Version: 1.0 In-Reply-To: <20170926143357.GA18758@lst.de> References: <20170925231404.32723-1-ross.zwisler@linux.intel.com> <20170925231404.32723-4-ross.zwisler@linux.intel.com> <20170926063234.GA6870@lst.de> <20170926143357.GA18758@lst.de> From: Dan Williams Date: Tue, 26 Sep 2017 11:11:55 -0700 Message-ID: Subject: Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path To: Christoph Hellwig Cc: Ross Zwisler , Andrew Morton , "linux-kernel@vger.kernel.org" , "Darrick J. Wong" , "J. Bruce Fields" , Dave Chinner , Jan Kara , Jeff Layton , linux-fsdevel , Linux MM , "linux-nvdimm@lists.01.org" , linux-xfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1247 Lines: 22 On Tue, Sep 26, 2017 at 7:33 AM, Christoph Hellwig wrote: > On Tue, Sep 26, 2017 at 06:59:37AM -0700, Dan Williams wrote: >> > I think you probably want an IOCB_DAX flag to check IS_DAX once and >> > then stick to it, similar to what we do for direct I/O. >> >> I wonder if this works better with a reference count mechanism >> per-file so that we don't need a hold a lock over the whole >> transition. Similar to request_queue reference counting, when DAX is >> being turned off we block new references and drain the in-flight ones. > > Maybe. But that assumes we want to be stuck in a perpetual binary > DAX on/off state on a given file. Which makes not only for an awkward > interface (inode or mount flag), but also might be fundamentally the > wrong thing to do for some media where you'd happily read directly > from it but rather buffer writes in DRAM. I think we'll always need an explicit override available, but yes we need to think about what the override looks like in the context of a kernel that is able to automatically pick the right I/O policy relative to the media type. A potential mixed policy for reads vs writes makes sense. Where would this finer grained I/O policy selection go other than more inode flags?