Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp205424pxf; Wed, 10 Mar 2021 04:32:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9eLC7e9QVtVPuadh3xDA6azInRV8LNDKcx4BTnvFwoWRgCQurKeOoEyr1mbdZwXdkOnh2 X-Received: by 2002:a17:906:3b99:: with SMTP id u25mr3354610ejf.277.1615379576618; Wed, 10 Mar 2021 04:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615379576; cv=none; d=google.com; s=arc-20160816; b=VxUtQ5zUHNtF+0UPI58LZBV6mAd/kOt3kekYAM8iBQLqcrPE3CBlsO+3cEP/ZNbYal N4HyCVaptfYR/w78hkExLkuQjgYynaiPLM6PkPAHPibgXhex3fObsPfFSZgHYJVQPZEW KQDnAYOlT4d1bamfb8jMx2R78TVaNKXXJPaMzNoFim9eZ6S5S9G11roJHRxByfyjB9v4 e5I1Ak0UrfVbZ6GsUePUDS9wEg3bqy5k06bzgKkCDzPlE2tip99s7YEY2NckiopDLqwj EkWfXKHlHtA5XL3y14w3f61d4NVetmv+EgGphmbhWIYV8C+rF1bMW9Q77GZOXU80IVA0 mqDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=atKgvCAVpItHVZX4pm9LPMJMeABJeY6Z3gkRYABn5yM=; b=X67hVeYS61kShiFbDR2wYOskhWYmklcCfGiZZ2OIdlGnWMbwP8+W6GpRpCmus7XmKp Bhsgd+glxegd2X/V0qGa3gnTXyyoZSnDNVlWXGZk92MYtKRJQcG/6Y0Cbzbrm+Y+0m0U vO2JkItZWLoJ4tqEfCtVJCxOUoPybVCKiwT32IIUd8tBbRwjLDmu9q+HeoMbe7H7tpeX juu+0URr6nub8CqrmNMhadMzMBO+fv9BpRo0zHDxfbtpCTgih8MOu2HsxjHSPEp9ABgD S0HOPuvBHH1fga4bmf2WLpkYP7XIbd6KFAfzir4T0AL9QBr/MJZJr4BGr99Wei4KtL63 wqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CqUqoL9k; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si12207793edz.435.2021.03.10.04.32.33; Wed, 10 Mar 2021 04:32:56 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CqUqoL9k; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232042AbhCJMb2 (ORCPT + 99 others); Wed, 10 Mar 2021 07:31:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbhCJMbS (ORCPT ); Wed, 10 Mar 2021 07:31:18 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCBBC061760; Wed, 10 Mar 2021 04:31:18 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id 133so17648198ybd.5; Wed, 10 Mar 2021 04:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=atKgvCAVpItHVZX4pm9LPMJMeABJeY6Z3gkRYABn5yM=; b=CqUqoL9kkvx+9GPDQrx/onWS2YqBsmUkD9RdH3kHKTKq0Cer4EZT4m88Jw1x4Fr3ay TiaLyhLOVS3KIjiESjXT/yUrAY3W1sZdEm6TSmA+7EtxpUAPl9UGLAHN1LPhHptz8M4W awatnKWJUohL/31zVJXD5w/KHKFHyP/tXqk0Ma2sIXDK6kPy8Zt1D+Va9Mfmvz7UOItG 5/DBwezK/etsdPHs3GV7GnvF0RLpA9aHGTPlINFPjl6Ceem8bSrdhpjAxCNFrmKNSnM1 3zAQJZQbW2rR8gGM7xa5X45SmKRn206FsjxUb9Z4X7woqN6A1P+KAmARKYNbS/6aUl9Z 5FIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=atKgvCAVpItHVZX4pm9LPMJMeABJeY6Z3gkRYABn5yM=; b=SQbrl3l/NtPbEHU1rGZJPfLlGyJTc8GtuGvk4lIEj61QOvNL60rfTOFnoumjQ4GIu3 KbsVR0YZPl12N8Wqu52Dmw4FfyS8yerMyDxzDU4zA/x/uSyLu6qpVJhTyWDqkrhiwIEU AwI3NxKsumdClXsENMLWCQL8OMvRb6Mh7pC4Qis9XhtHkZ1pgaD/nGdgYiFNdjrGBjAN E5nAE5eBI361uUe608tNyItHhQaBDO+p7/O4Y88/P2c8D6SQ1sDlP1CVVY41/owzCYpR 034JapJRo9eUiQ01bzxIuS4kzh3WAnaaoYbAHWUKcVL8chmp2dfagQhgS9IRbHIgDNR6 QcVg== X-Gm-Message-State: AOAM532JBhF3IFVB7X3me15KomSLtdLHGRRea1cA0PDtYPiOzysOedxg 9I42aJVQfdG+6SQ5sIX971vE7mbXUxXCyz28YUk= X-Received: by 2002:a05:6902:1001:: with SMTP id w1mr3859288ybt.176.1615379477739; Wed, 10 Mar 2021 04:31:17 -0800 (PST) MIME-Version: 1.0 References: <20210226002030.653855-1-ruansy.fnst@fujitsu.com> In-Reply-To: <20210226002030.653855-1-ruansy.fnst@fujitsu.com> From: Neal Gompa Date: Wed, 10 Mar 2021 07:30:41 -0500 Message-ID: Subject: Re: [PATCH v2 00/10] fsdax,xfs: Add reflink&dedupe support for fsdax To: Shiyang Ruan Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nvdimm@lists.01.org, linux-fsdevel , darrick.wong@oracle.com, dan.j.williams@intel.com, willy@infradead.org, jack@suse.cz, viro@zeniv.linux.org.uk, Btrfs BTRFS , ocfs2-devel@oss.oracle.com, david@fromorbit.com, hch@lst.de, rgoldwyn@suse.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2021 at 7:23 PM Shiyang Ruan wrot= e: > > This patchset is attempt to add CoW support for fsdax, and take XFS, > which has both reflink and fsdax feature, as an example. > > Changes from V1: > - Factor some helper functions to simplify dax fault code > - Introduce iomap_apply2() for dax_dedupe_file_range_compare() > - Fix mistakes and other problems > - Rebased on v5.11 > > One of the key mechanism need to be implemented in fsdax is CoW. Copy > the data from srcmap before we actually write data to the destance > iomap. And we just copy range in which data won't be changed. > > Another mechanism is range comparison. In page cache case, readpage() > is used to load data on disk to page cache in order to be able to > compare data. In fsdax case, readpage() does not work. So, we need > another compare data with direct access support. > > With the two mechanism implemented in fsdax, we are able to make reflink > and fsdax work together in XFS. > > > Some of the patches are picked up from Goldwyn's patchset. I made some > changes to adapt to this patchset. > > (Rebased on v5.11) Forgive my ignorance, but is there a reason why this isn't wired up to Btrfs at the same time? It seems weird to me that adding a feature like DAX to work with CoW filesystems is not being wired into *the* CoW filesystem in the Linux kernel that fully takes advantage of copy-on-write. I'm aware that XFS supports reflinks and does some datacow stuff, but I don't know if I would consider XFS integration sufficient for integrating this feature now, especially if it's possible that the design might not work with Btrfs (I hadn't seen any feedback from Btrfs developers, though given how much email there is here, it's entirely possible that I missed it). --=20 =E7=9C=9F=E5=AE=9F=E3=81=AF=E3=81=84=E3=81=A4=E3=82=82=E4=B8=80=E3=81=A4=EF= =BC=81/ Always, there's only one truth!