From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF8DFC433E0 for ; Mon, 10 Aug 2020 21:10:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 74DF5206B5 for ; Mon, 10 Aug 2020 21:10:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74DF5206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fromorbit.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 09C326B0003; Mon, 10 Aug 2020 17:10:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04CAB6B0005; Mon, 10 Aug 2020 17:10:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA4116B0006; Mon, 10 Aug 2020 17:10:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D552E6B0003 for ; Mon, 10 Aug 2020 17:10:53 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5CD42181AEF0B for ; Mon, 10 Aug 2020 21:10:53 +0000 (UTC) X-FDA: 77135903586.11.body46_3c02d1a26fdd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 2BC27180F8B80 for ; Mon, 10 Aug 2020 21:10:53 +0000 (UTC) X-HE-Tag: body46_3c02d1a26fdd X-Filterd-Recvd-Size: 4351 Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Aug 2020 21:10:52 +0000 (UTC) Received: from dread.disaster.area (pa49-180-53-24.pa.nsw.optusnet.com.au [49.180.53.24]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 924DAD5B48A; Tue, 11 Aug 2020 07:10:47 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1k5F49-0007Rd-HC; Tue, 11 Aug 2020 07:10:45 +1000 Date: Tue, 11 Aug 2020 07:10:45 +1000 From: Dave Chinner To: Matthew Wilcox Cc: Ruan Shiyang , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, darrick.wong@oracle.com, dan.j.williams@intel.com, hch@lst.de, rgoldwyn@suse.de, qi.fuli@fujitsu.com, y-goto@fujitsu.com Subject: Re: [RFC PATCH 0/8] fsdax: introduce FS query interface to support reflink Message-ID: <20200810211045.GL2114@dread.disaster.area> References: <20200807131336.318774-1-ruansy.fnst@cn.fujitsu.com> <20200807133857.GC17456@casper.infradead.org> <9673ed3c-9e42-3d01-000b-b01cda9832ce@cn.fujitsu.com> <20200810111657.GL17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200810111657.GL17456@casper.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=QIgWuTDL c=1 sm=1 tr=0 a=moVtWZxmCkf3aAMJKIb/8g==:117 a=moVtWZxmCkf3aAMJKIb/8g==:17 a=IkcTkHD0fZMA:10 a=y4yBn9ojGxQA:10 a=7-415B0cAAAA:8 a=_uXmcX_QWSfgQcGZoHUA:9 a=QEXdDO2ut3YA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Rspamd-Queue-Id: 2BC27180F8B80 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Aug 10, 2020 at 12:16:57PM +0100, Matthew Wilcox wrote: > On Mon, Aug 10, 2020 at 04:15:50PM +0800, Ruan Shiyang wrote: > >=20 > >=20 > > On 2020/8/7 =E4=B8=8B=E5=8D=889:38, Matthew Wilcox wrote: > > > On Fri, Aug 07, 2020 at 09:13:28PM +0800, Shiyang Ruan wrote: > > > > This patchset is a try to resolve the problem of tracking shared = page > > > > for fsdax. > > > >=20 > > > > Instead of per-page tracking method, this patchset introduces a q= uery > > > > interface: get_shared_files(), which is implemented by each FS, t= o > > > > obtain the owners of a shared page. It returns an owner list of = this > > > > shared page. Then, the memory-failure() iterates the list to be = able > > > > to notify each process using files that sharing this page. > > > >=20 > > > > The design of the tracking method is as follow: > > > > 1. dax_assocaite_entry() associates the owner's info to this page > > >=20 > > > I think that's the first problem with this design. dax_associate_e= ntry is > > > a horrendous idea which needs to be ripped out, not made more impor= tant. > > > It's all part of the general problem of trying to do something on a > > > per-page basis instead of per-extent basis. > > >=20 > >=20 > > The memory-failure needs to track owners info from a dax page, so I s= hould > > associate the owner with this page. In this version, I associate the= block > > device to the dax page, so that the memory-failure is able to iterate= the > > owners by the query interface provided by filesystem. >=20 > No, it doesn't need to track owner info from a DAX page. What it needs= to > do is ask the filesystem. Just to add to this: the owner tracking that is current done deep inside the DAX code needs to be moved out to the owner of the dax device. That may be the dax device itself, or it may be a filesystem like ext4 or XFS. Initially, nothing will be able to share pages and page owner tracking should be done on the page itself as the DAX code currently does. Hence when a page error occurs, the device owner is called with the page and error information, and the dax device or filesystem can then look up the page owner (via mapping/index pointers) and run the Die Userspace Die functions instead of running this all internally in the DAX code. Once the implementation is abstracted and controlled by the device owner, then we can start working to change the XFS implementation to support shared pages.... Cheers, Dave. --=20 Dave Chinner david@fromorbit.com