Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1360696pxb; Fri, 21 Jan 2022 16:30:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5CKY/+mtMMkNjRzFXg2ldFyz/3INERl2+A17jJjfv7F5YWiTt7p/sPvo4rMpcCgvsyaVM X-Received: by 2002:a63:be47:: with SMTP id g7mr4475936pgo.610.1642811427378; Fri, 21 Jan 2022 16:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642811427; cv=none; d=google.com; s=arc-20160816; b=A7HTc7Q6cGMY1rgZrNPf3Y7HVE4V4OlsPZT1I3WXyn3u/v2ZpFlG8qm8+wFaKtRqBg jXZAEA6vkm5WsRezo0mvkqvy7KTQQTXZ5nzuWccvsjBqZD7XTVP0w4gj3efLdzfLmxko tWalbk4RPYy6hojsQO7WYhp11GFQ0FOIwNPLnZf8gSZfS/80n/Lr9HgSItFVps7DL7U5 yQvaNwvJfZ5zgd9I6p/MbyG8X66UUgrd6N0SeiEcOc3JjQW7ivPv42J/RHnDbAP5A24q fHgduj4YHz7Ykqht7wKc39tgrmiizc2kiN6IDsjXAu2qDSpvpGL91pak/qHdh7fW8VgM mhQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :ironport-hdrordr:ironport-data; bh=0aQBsDZD8Ps4A/KM6MFWlj2lLYQjTv9XURa9FnDl6Po=; b=fMaXf0L41Au1zGuPzhOSomOp0gTAr/1ddYEwizZJAX9LJLYrZsQ7AgS4Z7zrQTSVDV ObagPk79O7OJywZqN6gfStJz4tjQjctYJPSZ9h7SdD80hM5/i7nCUit1zhN4cYkCTJnc w83lZuBWJ905g56wx35UiA2a9w4VrqW7tWvtTHzFyqA/cA1jjn0uuPle++6aBPmR3LU0 XkN2L2pAb8X0+KfWrXbLV/7aWSgwp7d63K0mxP495Vl1aCi5xkYzk8tzrJemTf81iTBq MueqPq4dZlQ4PsdL8XozotrMLUj2MeTJrKxa2CyDLlkQQwHXFPmnGhxH6IaR2wLhFmmh cy8w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s198si7166093pgs.316.2022.01.21.16.30.15; Fri, 21 Jan 2022 16:30:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378547AbiAUCeH (ORCPT + 99 others); Thu, 20 Jan 2022 21:34:07 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:45919 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1378483AbiAUCeF (ORCPT ); Thu, 20 Jan 2022 21:34:05 -0500 IronPort-Data: =?us-ascii?q?A9a23=3A8jWpIK8vHuEnOF7kREpCDrUD63+TJUtcMsCJ2f8?= =?us-ascii?q?bfWQNrUp33zxSxmFKXWjSP6uKa2Cje9F0PITn8UIG65CDzNJiSVdlrnsFo1Bi8?= =?us-ascii?q?5ScXYvDRqvT04J+FuWaFQQ/qZx2huDodKjYdVeB4Ef9WlTdhSMkj/vQH+CkULW?= =?us-ascii?q?s1h1ZHmeIdg9w0HqPpMZp2uaEsfDha++8kYuaT//3YTdJ6BYoWo4g0J9vnTs01?= =?us-ascii?q?BjEVJz0iXRlDRxDlAe2e3D4l/vzL4npR5fzatE88uJX24/+IL+FEmPxp3/BC/u?= =?us-ascii?q?ulPD1b08LXqXPewOJjxK6WYD72l4b+HN0if19aZLwam8O49mNt8pswdNWpNq+T?= =?us-ascii?q?xw1FqPRmuUBSAQeGCZ7VUFD0OadeSbi6JLPkCUqdFOpmZ2CFnoeMYQG++pfD3t?= =?us-ascii?q?J8PsCIjERKBuEgoqewLm7YuhqiN4qIMTiMMUYoH4I5T3QC7AkB4/CR6HL7NpD9?= =?us-ascii?q?DY2ms1KW/3ZYqIxZThwaxLPSx5CIFEaDNQ5hujArn3+dSBI7VeQjakp6mPQigt?= =?us-ascii?q?r39DFNsTZe9mPbcFUhVqD4GbH+XnpRB0XKrS3yzOD/zSnhvLnmjnyU4YfUra/8?= =?us-ascii?q?5ZChFyV23xWBgYaWEW2pdGnhUOkHdFSMUoZ/mwpt6da3EiqSMTtGh61uniJujY?= =?us-ascii?q?CVNdKVe438geAzuzT+QnxLmwFSCNRLcwor+coSjEwkFyEhdXkAXpoqrL9dJ433?= =?us-ascii?q?t94thvrYW5MczBEPnRCEGM4DxDYiNlbpnryohxLScZZVuHIJAw=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AW6esQatRAK2MUU2DkOwCCOZ77skDStV00zEX?= =?us-ascii?q?/kB9WHVpm62j5qSTdZEguCMc5wx+ZJheo7q90cW7IE80lqQFhLX5X43SPzUO0V?= =?us-ascii?q?HARO5fBODZsl/d8kPFltJ15ONJdqhSLJnKB0FmsMCS2mKFOudl7N6Z0K3Av4vj?= =?us-ascii?q?80s=3D?= X-IronPort-AV: E=Sophos;i="5.88,303,1635177600"; d="scan'208";a="120651647" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 21 Jan 2022 10:34:03 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id C8E454D15A5C; Fri, 21 Jan 2022 10:33:58 +0800 (CST) Received: from G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 21 Jan 2022 10:33:56 +0800 Received: from [192.168.22.28] (10.167.225.141) by G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Fri, 21 Jan 2022 10:33:56 +0800 Message-ID: <70a24c20-d7ee-064c-e863-9f012422a2f5@fujitsu.com> Date: Fri, 21 Jan 2022 10:33:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings To: Christoph Hellwig CC: , , , , , , , , References: <20211226143439.3985960-1-ruansy.fnst@fujitsu.com> <20211226143439.3985960-11-ruansy.fnst@fujitsu.com> From: Shiyang Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-yoursite-MailScanner-ID: C8E454D15A5C.A13C7 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/1/20 16:59, Christoph Hellwig 写道: > On Sun, Dec 26, 2021 at 10:34:39PM +0800, Shiyang Ruan wrote: >> +#define FS_DAX_MAPPING_COW 1UL >> + >> +#define MAPPING_SET_COW(m) (m = (struct address_space *)FS_DAX_MAPPING_COW) >> +#define MAPPING_TEST_COW(m) (((unsigned long)m & FS_DAX_MAPPING_COW) == \ >> + FS_DAX_MAPPING_COW) > > These really should be inline functions and probably use lower case > names. OK. > > But different question, how does this not conflict with: > > #define PAGE_MAPPING_ANON 0x1 > > in page-flags.h? Now we are treating dax pages, so I think its flags should be different from normal page. In another word, PAGE_MAPPING_ANON is a flag of rmap mechanism for normal page, it doesn't work for dax page. And now, we have dax rmap for dax page. So, I think this two kinds of flags are supposed to be used in different mechanisms and won't conflect. > > Either way I think this flag should move to page-flags.h and be > integrated with the PAGE_MAPPING_FLAGS infrastucture. And that's why I keep them in this dax.c file. -- Thanks, Ruan.