Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1365166pxb; Fri, 21 Jan 2022 16:37:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg4o9yNrUEJAT7I4noYkSb1++aCank5+Slq3Idl1fYFmT50+jg564gehMIEuKVCWKF5qvy X-Received: by 2002:a05:6a00:22d0:b0:4c7:5639:51e9 with SMTP id f16-20020a056a0022d000b004c7563951e9mr3603531pfj.40.1642811844195; Fri, 21 Jan 2022 16:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642811844; cv=none; d=google.com; s=arc-20160816; b=FTSlQf0fvqBg800QpYfktBs2/JwlCIysxUcWhMa6S2kKtGFtXArJirK43fzNbl1M4Y BoLElkxIjr3YrP5mh3idf3/elizy6HzoiXworKdOAcB3mD302GREeKes4jefD0TqQUKF Wy+CqWV1Y7CrGhGJsNqpvd0IAlAEsi2W7sKl3xQiGhdNGYor+lKxFnMTUIC4IM18xFhJ NL/RidxfYe21o85hcVDdbi5XmAmhZt0UmMqGkGe/7qe1ectC4lShXMFKIJM7dJkDbNRb ehUUnu+a3H+4HgNTMLc9Erz0AmA/7GDDyxvVyDwZRgYZZGObRHDz8hRJ5po08p32vQE4 HrFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sww/wwaWy03hlZ/EaFDFfo+1Npwvs31lVzyDCnqKm+M=; b=YVlfUSK7X8IjxI37b8If2EdxZM2i8TkNhN33iWhWk5oPllZqdswNzJXGdHJYGzdUwr +nzxXGxv7NEf6PplwttDaEx7G+NYvFFuKnG7gZ6RlBQKSK2HugY1L+IvF4bvIocUMKCI Z4BRx2F/IrFNRHB4YL2ZNTAh2IIp2IvTbTfwouQybDlFCEMd9NJG+Z/QRSk3KqP+6WgR AI8fKFSAhcPl6kM1+SqdoykN+ObrWS3rTAujUMAL8xzF8E+6ZiykTuZNZyNMEb3dp+OR yRzAl0e+dtKj5oMkxAGX7X2Dj2K9gDSVLw6QGGHjqS2uiwJPxvKQhHR1B0O8a4s0i1hj UMLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3z9uw5j+; 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 c5si8131498plg.443.2022.01.21.16.37.11; Fri, 21 Jan 2022 16:37:24 -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=@infradead.org header.s=bombadil.20210309 header.b=3z9uw5j+; 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 S1348864AbiAUHQZ (ORCPT + 99 others); Fri, 21 Jan 2022 02:16:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378878AbiAUHQY (ORCPT ); Fri, 21 Jan 2022 02:16:24 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9F58C061574; Thu, 20 Jan 2022 23:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=sww/wwaWy03hlZ/EaFDFfo+1Npwvs31lVzyDCnqKm+M=; b=3z9uw5j+S2pf6nD2ooQW91WtxK aPSDnO2M+uQJBElEk9lMsC/znXs6RQZ6CJhLkqIX0Iu9skcFdAY+ejjQCQyV/feQLF6NPePEK3nVR yBYKmHkRI/ytKK50oeZOBQQZJsGHb9Fyni/SDutvloNOoHUSGtQWStctL2Cmrw4ER5WnVDqZolW4G jDUhKW0OAwKdvwZIOp2Wlc0EK/QsfKDkbxW1gbf+VRxbSNt+YBfz54NvNhNFMzeX8OilBhT4XCMZt 5P7RkYEOjRPDUpOG8w2WElZiTVMC9hv/8WWSQIRDecZcHs4YOP4XvDyiiTJEZSq71XQvOKhYbCfIT KmYItTGg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAo9l-00E2By-OP; Fri, 21 Jan 2022 07:16:21 +0000 Date: Thu, 20 Jan 2022 23:16:21 -0800 From: Christoph Hellwig To: Shiyang Ruan Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org, dan.j.williams@intel.com, david@fromorbit.com, jane.chu@oracle.com Subject: Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings Message-ID: References: <20211226143439.3985960-1-ruansy.fnst@fujitsu.com> <20211226143439.3985960-11-ruansy.fnst@fujitsu.com> <70a24c20-d7ee-064c-e863-9f012422a2f5@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70a24c20-d7ee-064c-e863-9f012422a2f5@fujitsu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 10:33:58AM +0800, Shiyang Ruan wrote: > > > > 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. It just needs someone to use folio_test_anon in a place where a DAX folio can be passed. This probably should not happen, but we need to clearly document that. > > 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. But that does not integrate it with the infrastructure. For people to debug things it needs to be next to PAGE_MAPPING_ANON and have documentation explaining why they are exclusive.