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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 4CFF1C83008 for ; Tue, 28 Apr 2020 11:16:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1267C20663 for ; Tue, 28 Apr 2020 11:16:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BbEv0tv/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1267C20663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A2FD98E0005; Tue, 28 Apr 2020 07:16:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E09C8E0001; Tue, 28 Apr 2020 07:16:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F5F78E0005; Tue, 28 Apr 2020 07:16:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0215.hostedemail.com [216.40.44.215]) by kanga.kvack.org (Postfix) with ESMTP id 7564B8E0001 for ; Tue, 28 Apr 2020 07:16:39 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2D854181AEF07 for ; Tue, 28 Apr 2020 11:16:39 +0000 (UTC) X-FDA: 76757010918.24.flesh47_5726f86b43f2b X-HE-Tag: flesh47_5726f86b43f2b X-Filterd-Recvd-Size: 5405 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Apr 2020 11:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=u2H9SL+UMErMdRB2YXU6A5uO+y4zqg8b68UfJIqKHUU=; b=BbEv0tv/tpdRIsWJ5h4Vm4N5uQ N6PimFztig63e/oRDUJ0P7VhoKLjfva0KIy4rlZjQ2OheYN1i8n/GKpj2swy49MNk/3u3jcNMaGvn ye/iybuk4S7mglrs/hNIx6WJySktdeNKwPTGx/RPP0xLx6DFnyk4a0jqJCX6BncQiuHkzfusZOPPh bMgyUGN91SR7w+nOOebqqyYc7/cJ5mH98QgOYiw1Yk0d8xv1IGMzJwM0OBwI00wIucyImvp4Lg9um NaXoPXFKBqIYa/RLoTWaGGtZWGiiOvDLiQiQZFwaJAE7rHjxktGJjWcGK1wg+u+micKtkLYptCD2i cVFpmLJw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTOE8-0002zk-5p; Tue, 28 Apr 2020 11:16:36 +0000 Date: Tue, 28 Apr 2020 04:16:36 -0700 From: Matthew Wilcox To: Ruan Shiyang Cc: Dave Chinner , "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" , "Gotou, Yasunori" Subject: Re: =?utf-8?B?5Zue5aSNOiBSZQ==?= =?utf-8?Q?=3A?= [RFC PATCH 0/8] dax: Add a dax-rmap tree to support reflink Message-ID: <20200428111636.GK29705@bombadil.infradead.org> References: <20200427084750.136031-1-ruansy.fnst@cn.fujitsu.com> <20200427122836.GD29705@bombadil.infradead.org> <20200428064318.GG2040@dread.disaster.area> <259fe633-e1ff-b279-cd8c-1a81eaa40941@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <259fe633-e1ff-b279-cd8c-1a81eaa40941@cn.fujitsu.com> 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 Tue, Apr 28, 2020 at 05:32:41PM +0800, Ruan Shiyang wrote: > On 2020/4/28 =E4=B8=8B=E5=8D=882:43, Dave Chinner wrote: > > On Tue, Apr 28, 2020 at 06:09:47AM +0000, Ruan, Shiyang wrote: > > > =E5=9C=A8 2020/4/27 20:28:36, "Matthew Wilcox" =E5=86=99=E9=81=93: > > > > On Mon, Apr 27, 2020 at 04:47:42PM +0800, Shiyang Ruan wrote: > > > > > This patchset is a try to resolve the shared 'page cache' pro= blem for > > > > > fsdax. > > > > >=20 > > > > > 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 secon= d time we > > > > > associate this entry, we create this rb-tree and store its ro= ot in > > > > > page->private(not used in fsdax). Insert (->mapping, ->index= ) when > > > > > dax_associate_entry() and delete it when dax_disassociate_ent= ry(). > > > >=20 > > > > Do we really want to track all of this on a per-page basis? I wo= uld > > > > have thought a per-extent basis was more useful. Essentially, cr= eate > > > > a new address_space for each shared extent. Per page just seems = like > > > > a huge overhead. > > > >=20 > > > Per-extent tracking is a nice idea for me. I haven't thought of it > > > yet... > > >=20 > > > But the extent info is maintained by filesystem. I think we need a= way > > > to obtain this info from FS when associating a page. May be a bit > > > complicated. Let me think about it... > >=20 > > That's why I want the -user of this association- to do a filesystem > > callout instead of keeping it's own naive tracking infrastructure. > > The filesystem can do an efficient, on-demand reverse mapping lookup > > from it's own extent tracking infrastructure, and there's zero > > runtime overhead when there are no errors present. > >=20 > > At the moment, this "dax association" is used to "report" a storage > > media error directly to userspace. I say "report" because what it > > does is kill userspace processes dead. The storage media error > > actually needs to be reported to the owner of the storage media, > > which in the case of FS-DAX is the filesytem. >=20 > Understood. >=20 > BTW, this is the usage in memory-failure, so what about rmap? I have n= ot > found how to use this tracking in rmap. Do you have any ideas? >=20 > >=20 > > That way the filesystem can then look up all the owners of that bad > > media range (i.e. the filesystem block it corresponds to) and take > > appropriate action. e.g. >=20 > I tried writing a function to look up all the owners' info of one block= in > xfs for memory-failure use. It was dropped in this patchset because I = found > out that this lookup function needs 'rmapbt' to be enabled when mkfs. = But > by default, rmapbt is disabled. I am not sure if it matters... I'm pretty sure you can't have shared extents on an XFS filesystem if you _don't_ have the rmapbt feature enabled. I mean, that's why it exists.