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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,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 48ADCC83000 for ; Tue, 28 Apr 2020 15:40:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE03C206C0 for ; Tue, 28 Apr 2020 15:40:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Qyi1DXhp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE03C206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4128D8E0005; Tue, 28 Apr 2020 11:40:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C1F38E0001; Tue, 28 Apr 2020 11:40:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B0268E0005; Tue, 28 Apr 2020 11:40:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 0F48B8E0001 for ; Tue, 28 Apr 2020 11:40:10 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BEF0B8248D52 for ; Tue, 28 Apr 2020 15:40:09 +0000 (UTC) X-FDA: 76757674938.24.rail82_3b84d42320a20 X-HE-Tag: rail82_3b84d42320a20 X-Filterd-Recvd-Size: 8547 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Apr 2020 15:40:08 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SFcjSa155813; Tue, 28 Apr 2020 15:39:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=corp-2020-01-29; bh=dfXvM4xuNIeZaJFuK3qt5Sc+zWA9hEOGGKCO2odjOlY=; b=Qyi1DXhpYDb15soPsP+xFNjmBvH+QlXLmb2FA+WsRcY4d07OZOPz/2Kypv7HtI/zpmhr By2uzixHj+6ZgJiWW99kEjLGcLiS2hu1TISIxg6RuYesVDTd8NFg+K+TOL0CgNVptzXW PKTZOR/HU1xWAb0ctQ8+LX1X6pFYAn0pYlPfUTxYDMp5YdoXPh9vz1x/ZjSoVQWvy5AV Lg7ajSujOQkyVcBhlARH7gRr7l7qA5jB9Gs01AaPpjKrz4I3YGmpShh4Z+KbnanoTlKC A9eDlU05ZCQM+BJVV7iObWZJmybX/ZgYwHAT8yc/6f/2/rw6QElREC8AR5gCZkfywTD6 tg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 30nucg0rgq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 15:39:39 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SFahHn180974; Tue, 28 Apr 2020 15:37:38 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 30mxpga2ny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 15:37:38 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03SFbYAT031620; Tue, 28 Apr 2020 15:37:35 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Apr 2020 08:37:34 -0700 Date: Tue, 28 Apr 2020 08:37:32 -0700 From: "Darrick J. Wong" To: Dave Chinner Cc: Matthew Wilcox , 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" , "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: <20200428153732.GZ6742@magnolia> 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> <20200428111636.GK29705@bombadil.infradead.org> <20200428112441.GH2040@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200428112441.GH2040@dread.disaster.area> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280122 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1011 priorityscore=1501 mlxlogscore=999 impostorscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280122 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 09:24:41PM +1000, Dave Chinner wrote: > On Tue, Apr 28, 2020 at 04:16:36AM -0700, Matthew Wilcox wrote: > > 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'= problem for > > > > > > > fsdax. > > > > > > >=20 > > > > > > > In order to track multiple mappings and indexes on one pa= ge, 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 s= econd time we > > > > > > > associate this entry, we create this rb-tree and store it= s root in > > > > > > > page->private(not used in fsdax). Insert (->mapping, ->i= ndex) when > > > > > > > dax_associate_entry() and delete it when dax_disassociate= _entry(). > > > > > >=20 > > > > > > Do we really want to track all of this on a per-page basis? = I would > > > > > > have thought a per-extent basis was more useful. Essentially= , create > > > > > > a new address_space for each shared extent. Per page just se= ems like > > > > > > a huge overhead. > > > > > >=20 > > > > > Per-extent tracking is a nice idea for me. I haven't thought o= f it > > > > > yet... > > > > >=20 > > > > > But the extent info is maintained by filesystem. I think we ne= ed 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 filesyst= em > > > > callout instead of keeping it's own naive tracking infrastructure= . > > > > The filesystem can do an efficient, on-demand reverse mapping loo= kup > > > > 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 stora= ge > > > > 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 ha= ve not > > > 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 b= ad > > > > media range (i.e. the filesystem block it corresponds to) and tak= e > > > > appropriate action. e.g. > > >=20 > > > I tried writing a function to look up all the owners' info of one b= lock in > > > xfs for memory-failure use. It was dropped in this patchset becaus= e I found > > > out that this lookup function needs 'rmapbt' to be enabled when mkf= s. But > > > by default, rmapbt is disabled. I am not sure if it matters... > >=20 > > 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 exist= s. >=20 > You're confusing reflink with rmap. :) >=20 > rmapbt does all the reverse mapping tracking, reflink just does the > shared data extent tracking. >=20 > But given that anyone who wants to use DAX with reflink is going to > have to mkfs their filesystem anyway (to turn on reflink) requiring > that rmapbt is also turned on is not a big deal. Especially as we > can check it at mount time in the kernel... Are we going to turn on rmap by default? The last I checked, it did have a 10-20% performance cost on extreme metadata-heavy workloads. Or do we only enable it by default if mkfs detects a pmem device? (Admittedly, most people do not run fsx as a productivity app; the normal hit is usually 3-5% which might not be such a big deal since you also get (half of) online fsck. :P) --D > Cheers, >=20 > Dave. > --=20 > Dave Chinner > david@fromorbit.com