From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7BE1C433FE for ; Fri, 5 Nov 2021 03:09:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A38F261246 for ; Fri, 5 Nov 2021 03:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231222AbhKEDMe (ORCPT ); Thu, 4 Nov 2021 23:12:34 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:34350 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229647AbhKEDMd (ORCPT ); Thu, 4 Nov 2021 23:12:33 -0400 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211104190443.GK24333@magnolia> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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