Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp455734ybb; Wed, 1 Apr 2020 03:25:43 -0700 (PDT) X-Google-Smtp-Source: APiQypL4XszncNYmqQFJ2sbDsyiutmAGNA5r3C4N7hhCI7sKDCBhcX8bBRpzT/rWp+xFBlzI93j4 X-Received: by 2002:aca:5e0b:: with SMTP id s11mr2100791oib.111.1585736743746; Wed, 01 Apr 2020 03:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585736743; cv=none; d=google.com; s=arc-20160816; b=C7rodVYfKlNFZ93+dB2AX1s6p0FhO2TIg5/RtHL+Htdr9JDTWVzCCUGXU5kHPflODa VIqtcl0T8D6HOUzu926CLExgK+gaL9HyXKhmczmoaKai+ue8WoDXFaegoAvtQmCiBolF GVtVrBdHl6ORJ2MYcGuOLzTAbiuq7fYjLgQTTekojmao9xU+rrbke2BqwaNbTbyvb/aA ST1bNv6Ay3mPqR5o/21Wc39q5BiHqdZHvCd3jbqGZ8IBvgVLMUdZzHQR4PRruSkeYbat 9VCrQkqPT2DdgV8W/xmGx5tTVn7rX78eNs5DZi+3Bo5/9xJqDb/286AvTvOtzLJTlAHn TkLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=X+uA0iBa6q7zFF5AybBe22+UxeBcuGTfeuza3Utkv4I=; b=bjY+IUkxB6YGFeIUREc2ngdQ1Cil7U2vlzemKy64YPzfYMabFCMX44S5yhm83qrKz1 bUdmfnA+p5ZKn+2GLJF/XA23aXERSeR1fn/A08h9gHwUjEyMzfKqxsJcyd/slSbgpyGg JxOyThXLn4HO7yCXrvkz1g22V9/EfhQShghIWo46/hBGcIy8vboy5Ch3WCYjkakI2afm ZvlzpBhxJ0q3386faXDcWEzIXsF1aNNp2gH3wT3phPDGpoSBHM7riRdhfjuDZHAhQPFI 2iB5UIdwfAs7peePxwQJ0fc3aoVLPIdg8M8av++dOwhE4MZMOobR9mIMYgRt3NjELhCN qMnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p67si744469oig.41.2020.04.01.03.25.23; Wed, 01 Apr 2020 03:25:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbgDAKZQ (ORCPT + 99 others); Wed, 1 Apr 2020 06:25:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:46580 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbgDAKZP (ORCPT ); Wed, 1 Apr 2020 06:25:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 36C6DAD39; Wed, 1 Apr 2020 10:25:13 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 387F51E11F4; Wed, 1 Apr 2020 12:25:11 +0200 (CEST) Date: Wed, 1 Apr 2020 12:25:11 +0200 From: Jan Kara To: "Darrick J. Wong" Cc: Christoph Hellwig , Dave Chinner , "Theodore Y. Ts'o" , Dan Williams , Jan Kara , Ira Weiny , Linux Kernel Mailing List , Alexander Viro , linux-ext4 , linux-xfs , linux-fsdevel , Andrew Morton , Linus Torvalds Subject: Re: [PATCH V5 00/12] Enable per-file/per-directory DAX operations V5 Message-ID: <20200401102511.GC19466@quack2.suse.cz> References: <20200227052442.22524-1-ira.weiny@intel.com> <20200305155144.GA5598@lst.de> <20200309170437.GA271052@iweiny-DESK2.sc.intel.com> <20200311033614.GQ1752567@magnolia> <20200311062952.GA11519@lst.de> <20200316095224.GF12783@quack2.suse.cz> <20200316095509.GA13788@lst.de> <20200401040021.GC56958@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401040021.GC56958@magnolia> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 01-04-20 04:00:21, Darrick J. Wong wrote: > On Mon, Mar 16, 2020 at 10:55:09AM +0100, Christoph Hellwig wrote: > > On Mon, Mar 16, 2020 at 10:52:24AM +0100, Jan Kara wrote: > > > > This sounds reasonable to me. > > > > > > > > As for deprecating the mount option, I think at a minimum it needs to > > > > continue be accepted as an option even if it is ignored to not break > > > > existing setups. > > > > > > Agreed. But that's how we usually deprecate mount options. Also I'd say > > > that statx() support for reporting DAX state and some education of > > > programmers using DAX is required before we deprecate the mount option > > > since currently applications check 'dax' mount option to determine how much > > > memory they need to set aside for page cache before they consume everything > > > else on the machine... > > > > I don't even think we should deprecate it. It isn't painful to maintain > > and actually useful for testing. Instead we should expand it into a > > tristate: > > > > dax=off > > dax=flag > > dax=always > > > > where the existing "dax" option maps to "dax=always" and nodax maps > > to "dax=off". and dax=flag becomes the default for DAX capable devices. > > That works for me. In summary: > > - Applications must call statx to discover the current S_DAX state. > > - There exists an advisory file inode flag FS_XFLAG_DAX that can be > changed on files that have no blocks allocated to them. Changing > this flag does not necessarily change the S_DAX state immediately > but programs can query the S_DAX state via statx. I generally like the proposal but I think the fact that toggling FS_XFLAG_DAX will not have immediate effect on S_DAX will cause quite some confusion and ultimately bug reports. I'm thinking whether we could somehow improve this... For example an ioctl that would try to make set inode flags effective by evicting the inode (and returning EBUSY if the eviction is impossible for some reason)? Honza > > If FS_XFLAG_DAX is set and the fs is on pmem then it will always > enable S_DAX at inode load time; if FS_XFLAG_DAX is not set, it will > never enable S_DAX. Unless overridden... > > - There exists a dax= mount option. dax=off means "never set S_DAX, > ignore FS_XFLAG_DAX"; dax=always means "always set S_DAX (at least on > pmem), ignore FS_XFLAG_DAX"; and dax=iflag means "follow FS_XFLAG_DAX" > and is the default. "dax" by itself means "dax=always". "nodax" > means "dax=off". > > - There exists an advisory directory inode flag FS_XFLAG_DAX that can > be changed at any time. The flag state is copied into any files or > subdirectories created within that directory. If programs require > that file access runs in S_DAX mode, they'll have to create those > files themselves inside a directory with FS_XFLAG_DAX set, or mount > the fs with dax=always. > > Ok? Let's please get this part finished for 5.8, then we can get back > to arguing about fs-rmap and reflink and dax and whatnot. > > --D -- Jan Kara SUSE Labs, CR