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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74885C282C0 for ; Wed, 23 Jan 2019 19:11:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4522C2184B for ; Wed, 23 Jan 2019 19:11:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VpPOrb3R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbfAWTK6 (ORCPT ); Wed, 23 Jan 2019 14:10:58 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:40722 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbfAWTK6 (ORCPT ); Wed, 23 Jan 2019 14:10:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Mcy4pu6BEXNPzcI4VJVgNOk+TydwhWcGCXButsbc7Ew=; b=VpPOrb3RYtlMjJN9iKG1P8RDZ 0aNvn7VXX5pErSbjteO2NIpNlpDy1zbIpe+XpxrXdcRPy50zQTprS1SjK8j5aAA6Nwxdql9dI+1P0 TM4+zexe7XNnOheKkRaQQxedhTFWN2Dadtn6xrPXlBNfuhccU3w4qa2aNMDJc/K6k3wZTYSgyIkd8 XVbXg0gGeGo2eU/eyGXvFeuwhoh6EIUbUW/WZZuTT/rjbM3GJeCL75aE756bXRizlWD7l0of34vlL i4bvn1Up/n0gesn/WYWkFpQx44N57rTi19bfrkqiDvdcHmvEdah1De4JhmTP2oF+BCr9aGhmyrMuN FBlEbD/bQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gmNvD-0008PK-9g; Wed, 23 Jan 2019 19:10:47 +0000 Date: Wed, 23 Jan 2019 11:10:47 -0800 From: Matthew Wilcox To: Amir Goldstein Cc: lsf-pc@lists.linux-foundation.org, Al Viro , "Darrick J. Wong" , Dave Chinner , Jan Kara , Chris Mason , Miklos Szeredi , linux-fsdevel , Linux MM Subject: Re: [LSF/MM TOPIC] Sharing file backed pages Message-ID: <20190123191046.GA15311@bombadil.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Jan 23, 2019 at 10:48:58AM +0200, Amir Goldstein wrote: > Hi, > > In his session about "reflink" in LSF/MM 2016 [1], Darrick Wong brought > up the subject of sharing pages between cloned files and the general vibe > in room was that it could be done. > > In his talk about XFS subvolumes and snapshots [2], Dave Chinner said > that Matthew Willcox was "working on that problem". My solution is to move the DAX hacks into the page cache proper. For a reflinked file, the filesystem would create a canonical address_space to own the pages, and this is what ->mapping and ->index would refer to. Instances of that reflinked file would each have their own address_space, just as they have their own inode. The i_pages array would contain only PFN entries (until the COWs start). I'm currently at LCA; please excuse me for not participating more fully right now.