Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2656531ybz; Mon, 27 Apr 2020 01:52:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLuaPtTl2b1Gpym+ye0hUlU9ecNARsN9vnvvPbJcfoAaXP5GiAOGrmm+rTc63nhDP16badu X-Received: by 2002:aa7:d9d8:: with SMTP id v24mr16820156eds.27.1587977528554; Mon, 27 Apr 2020 01:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587977528; cv=none; d=google.com; s=arc-20160816; b=OzYnx/QB6c1f6HZNL/f/YksUO9kZklqkblW+YYUxP6Cg+WYoJsoDnwrUOZqvBl668v GKZuG4PEe9zX81Orl3F6++XNWvgjeLT7n3/sn8hmpB2Sx3MPYvpcdQhaX21crXsWYW6y ARbMpL6RDpPa4PdOiijr45/T0VTPGXgFOJFzsBJ12r5JMVya/jVXASu9Cu29R/vrrJlI zGCejs/XsWBA3mQwsxyOnUlXjZ2jNU8zaOW+Z02Siz3clmFrEZf9nVBdd8FwOgW8eKXB oXzJLGlpZIFRb4g03laVR5zYgoLfXBHQX/BRwE6PwcCrFjvOAnDri93/3d0uVuI/fvyx fuKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Pg4bRYt+CS24JS67nDBiyUpLtjm7/hyd0reGJH6Bfmc=; b=Jc69k1r2y3i8b9CeoH5XReByRyFqyqpSbt8Pb/VlMpHCzUqr6GzGw9NdvPGin/V10J 3sWuTc/yaK9nMcFT5RzUDmYZYN5WBL4JVdk9aYBvnto5+SG6+kVvfOznXjC3zz+VoWBT GSfkYnngPhVjgbUoQ6vlxFh+lqCVuaoEvXCw8I+X2/6wDnydHF2EPS/2kB267xwUglQ+ SkLGGe62/rvowaKOfLFKp41uHmLv+bGyN00Tyhw8V6ImCvtmhG4fakVqkvsTAGZGgjlc jxKClSS1jpEMY9JSd4wa/99YlBsiUL7IrMkNM+CPhy1kY7iGzNrjEgzTht4Z9XwhM5df kfmA== 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 j12si7844422ejs.153.2020.04.27.01.51.45; Mon, 27 Apr 2020 01:52:08 -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 S1726821AbgD0Isl (ORCPT + 99 others); Mon, 27 Apr 2020 04:48:41 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:3131 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726700AbgD0Isj (ORCPT ); Mon, 27 Apr 2020 04:48:39 -0400 X-IronPort-AV: E=Sophos;i="5.73,323,1583164800"; d="scan'208";a="90547651" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Apr 2020 16:48:31 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id B686750A9991; Mon, 27 Apr 2020 16:37:48 +0800 (CST) Received: from G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.203) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 27 Apr 2020 16:48:31 +0800 Received: from localhost.localdomain (10.167.225.141) by G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 27 Apr 2020 16:48:30 +0800 From: Shiyang Ruan To: , , CC: , , , , , , , , Subject: [RFC PATCH 0/8] dax: Add a dax-rmap tree to support reflink Date: Mon, 27 Apr 2020 16:47:42 +0800 Message-ID: <20200427084750.136031-1-ruansy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-yoursite-MailScanner-ID: B686750A9991.AE152 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset is a try to resolve the shared 'page cache' problem for fsdax. In order to track multiple mappings and indexes on one page, I introduced a dax-rmap rb-tree to manage the relationship. A dax entry will be associated more than once if is shared. At the second time we associate this entry, we create this rb-tree and store its root in page->private(not used in fsdax). Insert (->mapping, ->index) when dax_associate_entry() and delete it when dax_disassociate_entry(). We can iterate the dax-rmap rb-tree before any other operations on mappings of files. Such as memory-failure and rmap. Same as before, I borrowed and made some changes on Goldwyn's patchsets. These patches makes up for the lack of CoW mechanism in fsdax. The rests are dax & reflink support for xfs. (Rebased to 5.7-rc2) Shiyang Ruan (8): fs/dax: Introduce dax-rmap btree for reflink mm: add dax-rmap for memory-failure and rmap fs/dax: Introduce dax_copy_edges() for COW fs/dax: copy data before write fs/dax: replace mmap entry in case of CoW fs/dax: dedup file range to use a compare function fs/xfs: handle CoW for fsdax write() path fs/xfs: support dedupe for fsdax fs/dax.c | 343 +++++++++++++++++++++++++++++++++++++---- fs/ocfs2/file.c | 2 +- fs/read_write.c | 11 +- fs/xfs/xfs_bmap_util.c | 6 +- fs/xfs/xfs_file.c | 10 +- fs/xfs/xfs_iomap.c | 3 +- fs/xfs/xfs_iops.c | 11 +- fs/xfs/xfs_reflink.c | 79 ++++++---- include/linux/dax.h | 11 ++ include/linux/fs.h | 9 +- mm/memory-failure.c | 63 ++++++-- mm/rmap.c | 54 +++++-- 12 files changed, 498 insertions(+), 104 deletions(-) -- 2.26.2