Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2584706ybh; Fri, 24 Jul 2020 17:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhzyP+GPV2BJDHzDPKAGwIepwh6BqA10TfHN7hN9Q9diya9tpv5Tpkg3lPZ0MFCvfvY9Cg X-Received: by 2002:a17:906:1402:: with SMTP id p2mr11075324ejc.126.1595636575918; Fri, 24 Jul 2020 17:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595636575; cv=none; d=google.com; s=arc-20160816; b=T/74zWH923MyC23hF1jtcPDydX96jSSOcacl4jEPrPICpSD9+1S1dxoRhf039T5hum KtGslYs4DZI6B7TBErPAjODH5lTC9zxXX4dUHWd7FtIjtK/T//45mquJH3HwyhJ7JWbB gJvN0EiNnCAOl2BQF3XSvOXZHnvUccwLtXp+4ybc8bXtpuktIDqKYiJMZLtq5CW0W57N FFdeAENl7ioTp9ZuSlTjdXzBk233RoG3Hhbd4AHJL+T4oAt9uSccRbh7hrQvOd5tRCwi R6rlaG5Myt54KO5iKaKeV8UsmER4NavHNqQF+3eOMStXTOlfIvWwcxd4xqdwezzQj9S7 80Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=wsinPs9jOTLdg7+PUL45aCgGuhnJ794Uss1UXepp984=; b=0ybwg3brXci3Epnk8p5kb/hbd3aHRz+iDC2+XRBc7IRQM/n5DyXGYjH8KDCU4ocHAC cDhks/CXuWk8agAZ1ePhSYlbY73tYkHf6OUEw/oKRU0698ZV8IvDb9CUlLa9i4vlHewC KYTPXAV6haQ3DQuoPoKYVYY7Uyevg8w0afIZj5qN8syOY8ED8iW7QxgI6XIBiJk+P5jE w4IuGMQtUtGwD3IhxZGXFcNF1PW/3RxXL34ZCRQnQASrBKtaUa6YNKQAz/0KHEc6D5XV yPeZoDWsrIv2P/IFo5BYRcKoKYpf9SJW8DJ24GDALDYGwn7umXPyyvicq+onTx75qpBD 2IWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si1488694ejz.484.2020.07.24.17.22.32; Fri, 24 Jul 2020 17:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbgGYAWW (ORCPT + 99 others); Fri, 24 Jul 2020 20:22:22 -0400 Received: from shells.gnugeneration.com ([66.240.222.126]:38216 "EHLO shells.gnugeneration.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbgGYAWW (ORCPT ); Fri, 24 Jul 2020 20:22:22 -0400 Received: by shells.gnugeneration.com (Postfix, from userid 1000) id 9A7951A40314; Fri, 24 Jul 2020 17:22:21 -0700 (PDT) Date: Fri, 24 Jul 2020 17:22:21 -0700 From: Vito Caputo To: linux-kernel Cc: linux-fsdevel@vger.kernel.org, Dave Chinner Subject: [QUESTION] Sharing a `struct page` across multiple `struct address_space` instances Message-ID: <20200725002221.dszdahfhqrbz43cz@shells.gnugeneration.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello folks, I've been poking around the shmem/tmpfs code with an eye towards adding reflink support to tmpfs. Prior to looking at the code, conceptually I was envisioning the pages in the reflink source inode's address_space would simply get their refcounts bumped as they were added to the dest inode's address_space, with some CoW flag set to prevent writes. But there seems to be a fundamental assumption that a `struct page` would only belong to a single `struct address_space` at a time, as it has single `mapping` and `index` members for reverse mapping the page to its address_space. Am I completely lost here or does it really look like a rather invasive modification to support this feature? I have vague memories of Dave Chinner mentioning work towards sharing pages across address spaces in the interests of getting reflink copies more competitive with overlayfs in terms of page cache utilization. Dave did you ever end up going down this path? Regards, Vito Caputo