From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C73652C99 for ; Fri, 5 Nov 2021 03:13:02 +0000 (UTC) Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 1A539JCp001043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Nov 2021 23:09:19 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 215AA15C00B9; Thu, 4 Nov 2021 23:09:19 -0400 (EDT) Date: Thu, 4 Nov 2021 23:09:19 -0400 From: "Theodore Ts'o" To: "Darrick J. Wong" Cc: Dan Williams , Christoph Hellwig , Eric Sandeen , Mike Snitzer , Ira Weiny , device-mapper development , linux-xfs , Linux NVDIMM , linux-s390 , linux-fsdevel , linux-erofs@lists.ozlabs.org, linux-ext4 , virtualization@lists.linux-foundation.org Subject: Re: futher decouple DAX from block devices Message-ID: References: <20211018044054.1779424-1-hch@lst.de> <21ff4333-e567-2819-3ae0-6a2e83ec7ce6@sandeen.net> <20211104081740.GA23111@lst.de> <20211104173417.GJ2237511@magnolia> <20211104173559.GB31740@lst.de> <20211104190443.GK24333@magnolia> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211104190443.GK24333@magnolia> On Thu, Nov 04, 2021 at 12:04:43PM -0700, Darrick J. Wong wrote: > > Note that I've avoided implementing read/write fops for dax devices > > partly out of concern for not wanting to figure out shared-mmap vs > > write coherence issues, but also because of a bet with Dave Hansen > > that device-dax not grow features like what happened to hugetlbfs. So > > it would seem mkfs would need to switch to mmap I/O, or bite the > > bullet and implement read/write fops in the driver. > > That ... would require a fair amount of userspace changes, though at > least e2fsprogs has pluggable io drivers, which would make mmapping a > character device not too awful. > > xfsprogs would be another story -- porting the buffer cache mignt not be > too bad, but mkfs and repair seem to issue pread/pwrite calls directly. > Note that xfsprogs explicitly screens out chardevs. It's not just e2fsprogs and xfsprogs. There's also udev, blkid, potententially systemd unit generators to kick off fsck runs, etc. There are probably any number of user scripts which assume that file systems are mounted on block devices --- for example, by looking at the output of lsblk, etc. Also note that block devices have O_EXCL support to provide locking against attempts to run mkfs on a mounted file system. If you move dax file systems to be mounted on a character mode device, that would have to be replicated as well, etc. So I suspect that a large number of subtle things would break, and I'd strongly recommend against going down that path. - Ted