From patchwork Wed Apr 17 01:40:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10904337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87F861515 for ; Wed, 17 Apr 2019 01:40:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6881C281C3 for ; Wed, 17 Apr 2019 01:40:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A6DB283A8; Wed, 17 Apr 2019 01:40:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DD0281C3 for ; Wed, 17 Apr 2019 01:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730177AbfDQBkE (ORCPT ); Tue, 16 Apr 2019 21:40:04 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:46364 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728514AbfDQBkE (ORCPT ); Tue, 16 Apr 2019 21:40:04 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3H1cPnh086741 for ; Wed, 17 Apr 2019 01:40:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=n20GzZw3x5jqWtX7osUfyxlS5eqs9HwuINCWUlCifzc=; b=MRHjSZftOGbmB4ZCBf4576kyk9V4oUIB1ZXAHVrKhadgvrldX4ilt9v+1+X2f7/PqYAN b1zaVd3c24FL7dMLEx+US8dBx7cK8Dr03tWwbFEPeObsgLAjltNA4c4bxrftJ1uJrCjC QT5awqm/3NEHyfPKAfbyqXFdoR4DzLAa6oNVMu63SKLLYJBZAcf9pG0IW9KnWVnOrMNy ozD2IMvQriE12un2nhlPtUb6TYulOcGR4qwyQR4IS1yYPhD/+8KayBbzJI6jP+qp9Vfk QgLaQErHDTs6FPdZCsRMwUpwrV1euIkhwyhj2jCS5Dx8JWnAjDqFjpOW/NML4QDKUAry vA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 2ru59d809r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2019 01:40:02 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3H1c6kW015498 for ; Wed, 17 Apr 2019 01:40:02 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2rwe7a41b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2019 01:40:02 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x3H1e1PM001174 for ; Wed, 17 Apr 2019 01:40:01 GMT Received: from localhost (/10.159.224.90) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 16 Apr 2019 18:40:00 -0700 Subject: [PATCH 0/3] xfs: scrub filesystem summary counters From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Tue, 16 Apr 2019 18:40:00 -0700 Message-ID: <155546519998.176278.8300210828717055034.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9229 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904170007 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9229 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904170007 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi all, This patch series introduces a totally new filesystem summary counter online scrub feature. Whereas previous iterations froze the filesystem to count inodes and free blocks, this one drastically reduces overhead by loosening its precision somewhat. Instead of freezing the fs, we race the expected summary counter calculation with normal fs operations and use thresholding to check that the counters are in the ballpark, where ballpark means "off by less than 6% or so". The first patch implements a per-cpu counter of the number of blocks being held in delayed allocation reservations. This should represent the difference between the incore fdblocks counter and the one that would be recorded on disk if one were to iterate all the committed metadata structures. Patch #2 enables the scrub code to pause the posteof and cowblocks background reclamation workers temporarily to reduce perturbations in the summary counters while the scrubber runs. This isn't totally foolproof since they can be re-armed, but we only need ballpark correctness. Finally, patch #3 implements the actual fs summary counter scrubber code. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=scrub-summary-counters xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=scrub-summary-counters