From patchwork Wed Dec 19 19:30:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10738061 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 381F36C5 for ; Wed, 19 Dec 2018 19:30:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 275B828355 for ; Wed, 19 Dec 2018 19:30:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 258F628387; Wed, 19 Dec 2018 19:30:13 +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 C60B62832B for ; Wed, 19 Dec 2018 19:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbeLSTaL (ORCPT ); Wed, 19 Dec 2018 14:30:11 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:48234 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727383AbeLSTaL (ORCPT ); Wed, 19 Dec 2018 14:30:11 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBJJTXDr155332; Wed, 19 Dec 2018 19:30:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=mrXyjaeJgnjv16h/9EYM0oY60Hm5Pkef/yMVx0F1H3o=; b=ewGxQZT9naK5hrbw72z7ny5eogwCvkLEucZotT3qAJMvgfKO85D/T8M+X3NSAXxptqxc CQld2cDztriRW50dc6O6eJh5Ee8jX9dWQkfTk4WKfl6/5uO7c409xbDdXkbJ8ElccZUL 09Zb2b8FBxQ8Ugmu7ljOzRGyyEsO+XIkPhQkAboP+/ZM1ws33WAPOF5bfLdjFVYRyffb z6EAsoi3ta3H6iKaBFM4byOYjhmAWkysi1pS2QUa+rmzid3llI/FkhMFJjAyR9xnsTam 4e1Kr9nLuO/7/0IyUzKA8JkHTTPP72xoBSN5RxQkyD2uuqKc8Sk9L4CGbaN1cU8OQ7DP Jg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2pf8gfdamc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Dec 2018 19:30:07 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBJJU6WO015683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Dec 2018 19:30:06 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wBJJU6Qt016400; Wed, 19 Dec 2018 19:30:06 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Dec 2018 11:30:05 -0800 Subject: [PATCH 5/8] xfs_scrub: use data/rtdev parallelization estimates for the read-verify pool From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Wed, 19 Dec 2018 11:30:05 -0800 Message-ID: <154524780496.28646.2648041743792188824.stgit@magnolia> In-Reply-To: <154524776457.28646.3004453037075812416.stgit@magnolia> References: <154524776457.28646.3004453037075812416.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9112 signatures=668680 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-1812190152 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 From: Darrick J. Wong Since we use the same read-verify pool object to dispatch file data read requests for both the data device and the realtime device, we should create enough IO threads to handle the estimated parallelization of both devices, not just the data device. Signed-off-by: Darrick J. Wong --- scrub/phase6.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scrub/phase6.c b/scrub/phase6.c index ead48d77..cbda9b53 100644 --- a/scrub/phase6.c +++ b/scrub/phase6.c @@ -435,6 +435,22 @@ xfs_check_rmap( return true; } +/* + * Estimate the amount of parallelization possible for scanning file data on + * the data and realtime devices. + */ +static unsigned int +phase6_threads( + struct scrub_ctx *ctx) +{ + unsigned int nr = disk_heads(ctx->datadev); + + if (ctx->rtdev) + nr += disk_heads(ctx->rtdev); + + return nr > nproc ? nproc : nr; +} + /* * Read verify all the file data blocks in a filesystem. Since XFS doesn't * do data checksums, we trust that the underlying storage will pass back @@ -469,7 +485,7 @@ xfs_scan_blocks( } ve.readverify = read_verify_pool_init(ctx, ctx->geo.blocksize, - xfs_check_rmap_ioerr, disk_heads(ctx->datadev)); + xfs_check_rmap_ioerr, phase6_threads(ctx)); if (!ve.readverify) { moveon = false; str_info(ctx, ctx->mntpoint, @@ -525,7 +541,7 @@ xfs_estimate_verify_work( return moveon; *items = ((d_blocks - d_bfree) + (r_blocks - r_bfree)) << ctx->blocklog; - *nr_threads = disk_heads(ctx->datadev); + *nr_threads = phase6_threads(ctx); *rshift = 20; return moveon; }