From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) (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 ACE4A48F822; Thu, 6 Aug 2026 20:41:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786048887; cv=none; b=pSzAwD36BcriZmKqZqSBYJ22vcgcNwDJ4f4Fys+lQ+ilfbqfv5s47xYGorHuRbXK3pqbnpF7ObpMdH2TEDoTug5L+fWfELpDabQZNDQmGSf8o60OaMTc1oldhw6m6e20PDjtvT3S7U/4Yx0Zz/JOuYMjWZIN035Aia1E8kDGunA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786048887; c=relaxed/simple; bh=xR6HG6PiaFqYPWaSc0BbpGc+xguUSO7QguoVLPIuIIk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LAvX1cS0DaERMgH3SW+b+wcEVLQL21F0cUrTLHCaY0Hq8oo7Ad+xU42h6LDBRjZdudKIgzZNWkt0gOV5pmUnCKR7EWU2nH2cuxPaDLbVBFXcoL9TiVO0QhYfSpBhq9cu84yhOqN1a8or7pqQDp//6OpJNCTV7gl1TnfB4jH8qPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=groves.net; spf=pass smtp.mailfrom=groves.net; arc=none smtp.client-ip=216.40.44.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=groves.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=groves.net Received: from omf14.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 811A9C0208; Thu, 6 Aug 2026 20:41:14 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: john@groves.net) by omf14.hostedemail.com (Postfix) with ESMTPA id 0254130; Thu, 6 Aug 2026 20:40:57 +0000 (UTC) Date: Thu, 6 Aug 2026 15:40:56 -0500 From: John Groves To: "Darrick J. Wong" Cc: John Groves , Miklos Szeredi , Dan Williams , Bernd Schubert , Alison Schofield , John Groves , Jonathan Corbet , Jake Edge , Shuah Khan , Vishal Verma , Dave Jiang , Matthew Wilcox , Jan Kara , Alexander Viro , David Hildenbrand , Christian Brauner , Randy Dunlap , Jeff Layton , Amir Goldstein , Jonathan Cameron , Stefan Hajnoczi , Joanne Koong , Josef Bacik , Bagas Sanjaya , Chen Linxuan , James Morse , Fuad Tabba , Sean Christopherson , Shivank Garg , Ackerley Tng , Gregory Price , Andrew Morton , Namjae Jeon , Lorenzo Stoakes , Greg Kroah-Hartman , Ira Weiny , Pasha Tatashin , Haren Myneni , Pratyush Yadav , Giovanni Cabiddu , Jiri Slaby , Ethan Nelson-Moore , Gabriel Whigham , Aravind Ramesh , Ajay Joshi , "venkataravis@micron.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "nvdimm@lists.linux.dev" , "linux-cxl@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "fuse-devel@lists.linux.dev" Subject: Re: [PATCH V12 06/12] famfs: Introduce mmap and VM fault handling Message-ID: References: <0100019fc572ca94-ec363dd7-3a77-484b-b4b7-f2503a0931a6-000000@email.amazonses.com> <20260803022909.75856-1-john@jagalactic.com> <0100019fc5743aef-39284cf3-b235-4a69-832f-c51b2198e8da-000000@email.amazonses.com> <20260806051643.GF3560084@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260806051643.GF3560084@frogsfrogsfrogs> X-Rspamd-Queue-Id: 0254130 X-Stat-Signature: rgkrbshmb4e5xmnxcodmnkbtuy4zi1hh X-Rspamd-Server: rspamout03 X-Session-Marker: 6A6F686E4067726F7665732E6E6574 X-Session-ID: U2FsdGVkX1+E2Va6GuIuXSLukgenZUgCPOnJ1XdWtXg= X-HE-Tag: 1786048857-712595 X-HE-Meta: U2FsdGVkX18tDPFgu0OyBXUVVFumMXeX6MI7yVjs5QcOa2qMbkCR4fyrWsOwrcAliP+/0VRtGY04vN7FfLDx9/+XWXXKl5CdWNwz3bxG5ZuP4FvGiy6zEOi5mxjRzx2Xj1FqlZbmKPsGML3hXhEEO/8b9pOIgxqy0pkbFbt9X3FXkjkHbSijiOq/00NE0yIsvJjky3qzKUB/tPcFW1L+7hNKSHFMKYvmK7EAjLoGD2UPQL7URStfeGlAScywurhpMu8zX5bn/ID3BeYLJzpv3sTzKPfML8DtspQw7HM7QrLAOCn6tlbwgGR9bfgtqQ6/1FysFaoFbkADyJqIRAd0nl8s5GJM1uAMr4DXkTgTXNa43IViI67fUGg1D8QiSYmw On 26/08/05 10:16PM, Darrick J. Wong wrote: > On Mon, Aug 03, 2026 at 02:29:16AM +0000, John Groves wrote: > > From: John Groves > > > > This commit adds vm_operations, plus famfs_mmap() and fault handlers. > > It is still missing iomap_ops, iomap mapping resolution, and > > famfs_ioctl() for setting up file-to-memory mappings. > > > > Signed-off-by: John Groves > > --- > > fs/famfs/famfs_file.c | 101 +++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 100 insertions(+), 1 deletion(-) > > > > diff --git a/fs/famfs/famfs_file.c b/fs/famfs/famfs_file.c > > index e192b573c51f..678f2035fd5f 100644 > > --- a/fs/famfs/famfs_file.c > > +++ b/fs/famfs/famfs_file.c > > @@ -16,6 +16,75 @@ > > > > #include "famfs_internal.h" > > > > +/********************************************************************* > > + * vm_operations > > + */ > > +static vm_fault_t > > +__famfs_filemap_fault(struct vm_fault *vmf, unsigned int order, > > + bool write_fault) > > +{ > > + struct inode *inode = file_inode(vmf->vma->vm_file); > > + struct super_block *sb = inode->i_sb; > > + struct famfs_fs_info *fsi = sb->s_fs_info; > > + vm_fault_t ret; > > + unsigned long pfn; > > + > > + if (fsi->deverror) > > + return VM_FAULT_SIGBUS; > > + > > + if (!IS_DAX(file_inode(vmf->vma->vm_file))) { > > + pr_err("%s: file not marked IS_DAX!!\n", __func__); > > + return VM_FAULT_SIGBUS; > > + } > > + > > + if (write_fault) { > > + sb_start_pagefault(inode->i_sb); > > + file_update_time(vmf->vma->vm_file); > > + } > > + > > + ret = dax_iomap_fault(vmf, order, &pfn, NULL, NULL /*&famfs_iomap_ops */); > > + if (ret & VM_FAULT_NEEDDSYNC) > > + ret = dax_finish_sync_fault(vmf, order, pfn); > > + > > + if (write_fault) > > + sb_end_pagefault(inode->i_sb); > > + > > + return ret; > > +} > > + > > +static inline bool > > +famfs_is_write_fault(struct vm_fault *vmf) > > +{ > > + return (vmf->flags & FAULT_FLAG_WRITE) && > > + (vmf->vma->vm_flags & VM_SHARED); > > +} > > + > > +static vm_fault_t > > +famfs_filemap_fault(struct vm_fault *vmf) > > +{ > > + return __famfs_filemap_fault(vmf, 0, famfs_is_write_fault(vmf)); > > +} > > + > > +static vm_fault_t > > +famfs_filemap_huge_fault(struct vm_fault *vmf, unsigned int order) > > +{ > > + return __famfs_filemap_fault(vmf, order, famfs_is_write_fault(vmf)); > > +} > > + > > +static vm_fault_t > > +famfs_filemap_mkwrite(struct vm_fault *vmf) > > +{ > > + return __famfs_filemap_fault(vmf, 0, true); > > Do neither of the conditions in famfs_is_write_fault apply here? I'm confident this is correct. This is directly copied from xfs on the dax path: if (IS_DAX(inode)) ret = xfs_dax_fault_locked(vmf, order, true); Famfs never has to do COW or allocate a page or any of that sort of sfuff; It ends up just looking at the fmap to resolve to a page, which always exists unless out or range or bugs. > > The rest of the patch looks ok to me. > > --D Thank you! John