From patchwork Tue Oct 18 01:52:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9485885 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5,RP_MATCHES_RCVD=-0.1,UNPARSEABLE_RELAY=0.001 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id C5ED54CEBDB for ; Mon, 17 Oct 2016 20:52:49 -0500 (CDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932610AbcJRBws (ORCPT ); Mon, 17 Oct 2016 21:52:48 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51013 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932571AbcJRBws (ORCPT ); Mon, 17 Oct 2016 21:52:48 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9I1qk3E019979 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Oct 2016 01:52:46 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u9I1qj1Y013193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Oct 2016 01:52:45 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id u9I1qjxe015397; Tue, 18 Oct 2016 01:52:45 GMT Received: from localhost (/24.21.211.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Oct 2016 18:52:44 -0700 Date: Mon, 17 Oct 2016 18:52:44 -0700 From: "Darrick J. Wong" To: david@fromorbit.com Cc: linux-xfs@vger.kernel.org Subject: [PATCH] docs: update refcount btree to reflect new cow staging extent policy Message-ID: <20161018015243.GC20337@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org We now record the extents being used to stage a copy on write operation in the refcount btree with the high bit of rc_startblock set and a reference count of 1. Setting the high bit helps us reduce CoW GC time at mount by moving all the records to the right side of the tree. Signed-off-by: Darrick J. Wong --- .../XFS_Filesystem_Structure/refcountbt.asciidoc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/design/XFS_Filesystem_Structure/refcountbt.asciidoc b/design/XFS_Filesystem_Structure/refcountbt.asciidoc index dbbb98e..508a9dd 100644 --- a/design/XFS_Filesystem_Structure/refcountbt.asciidoc +++ b/design/XFS_Filesystem_Structure/refcountbt.asciidoc @@ -25,7 +25,10 @@ struct xfs_refcount_rec { ---- *rc_startblock*:: -AG block number of this record. +AG block number of this record. The high bit is set for all records +referring to an extent that is being used to stage a copy on write +operation. This reduces recovery time during mount operations. The +reference count of these staging events must only be 1. *rc_blockcount*:: The length of this extent. @@ -81,12 +84,18 @@ lsn = 0x200004ec2 uuid = f1f89746-e00b-49c9-96b3-ecef0f2f14ae owner = 0 crc = 0xc3962813 (correct) -recs[1-80] = [startblock,blockcount,refcount] - 1:[65780,1,2] 2:[65781,1,3] 3:[65785,2,2] 4:[66640,1,2] - 5:[69602,4,2] 6:[72256,16,2] 7:[72871,4,2] 8:[72879,20,2] - 9:[73395,4,2] 10:[75063,4,2] 11:[79093,4,2] 12:[86344,16,2] +recs[1-80] = [startblock,blockcount,refcount,cowflag] + 1:[65780,1,2,0] 2:[65781,1,3,0] 3:[65785,2,2,0] 4:[66640,1,2,0] + 5:[69602,4,2,0] 6:[72256,16,2,0] 7:[72871,4,2,0] 8:[72879,20,2,0] + 9:[73395,4,2,0] 10:[75063,4,2,0] 11:[79093,4,2,0] 12:[86344,16,2,0] + ... + 80:[35235,10,1,1] ---- +Notice record 80. The copy on write flag is set and the reference count is +1, which indicates that the extent 35,235 - 35,244 are being used to stage a +copy on write activity. The "cowflag" field is the high bit of rc_startblock. + Record 6 in the reference count B+tree for AG 0 indicates that the AG extent starting at block 72,256 and running for 16 blocks has a reference count of 2. This means that there are two files sharing the block: