Received: by 10.223.185.111 with SMTP id b44csp1655554wrg; Sat, 10 Mar 2018 10:44:33 -0800 (PST) X-Google-Smtp-Source: AG47ELvaXzPNvPwu8ob3lgOlzmiYzm6U6wogIb50D07C70FpWbe+iU4Gw/J9RIkX+DX2FvVA0fh5 X-Received: by 2002:a17:902:b903:: with SMTP id bf3-v6mr2848278plb.316.1520707473764; Sat, 10 Mar 2018 10:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520707473; cv=none; d=google.com; s=arc-20160816; b=Me6brv/S/en/orTrlFjBuAjKqHIQwaDfe2kzBjMB6fHrqcpcgTTyrreV0AEcfJO8VZ 5V7bVeBS50SUg4ZZWRscw86wYAJVtZPHNMtuDUs0zutOjrGKPWID9386w1hIbxUv7JLm cQvqBTyUITbgANmvLj9M3wpkuccw+b/LNxZ0nSJKQcH5YiDWHJxrYe4fncSkHyz3Akaj s1CwxX71Rz6zfUoxKZ1VrNtW/uACo+eweozZZRc+GuooY/+8tngMELolRz5AO092MvEM 97kRJpVlL4QhM/4j603fUcAg58+qNfypcjq/EJjEyWKIAyjRcKrwYXre3lvZqPVBd6Yh cCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OLOIhAALAcSrRbS5r3bPdImQRIMt1Znibp//4bnXbDU=; b=Ekynsy46V5gTDcLbdD2kqbFBRp+ho/znOPp7RYfMErmmJMhI4A0fC72pOzjrOcKpoI MEB02IgBHSGSfyqUJwhhe9Lb2oKX/yFmo8t7e3NNG2ieoOtFxfK11J7GkHStXzJ4gEkr Sbz1clag/QiAY/NobxXw8d221S1CSa1yKZOekUJVPWh0Hu2t9SEu3uxTRZAEJjAr6hXs tkg62p9Zfp4DV4DHKu8Vg7XyKuiZ8RX+kZk78Zz/7xClBUeYUQOoz1h6Wl7jICbVV6yV wDNcljDTndWMFIqZaCv4td96gbAkQ/e2QAvANP5YL8V9DqzlGRY+UYKNVIAxIrZ22wCL fXVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=TVlfbWJk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11-v6si3108788plc.376.2018.03.10.10.44.19; Sat, 10 Mar 2018 10:44:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=TVlfbWJk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751478AbeCJSnO (ORCPT + 99 others); Sat, 10 Mar 2018 13:43:14 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:46197 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932279AbeCJSUa (ORCPT ); Sat, 10 Mar 2018 13:20:30 -0500 Received: by mail-pl0-f68.google.com with SMTP id y8-v6so7003105pll.13 for ; Sat, 10 Mar 2018 10:20:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eng.ucsd.edu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OLOIhAALAcSrRbS5r3bPdImQRIMt1Znibp//4bnXbDU=; b=TVlfbWJkPV1aHhRjDougVgl9eHP3ERwU4netAt7FJ9omiafq1uzqJEkE5/JCi7QqpN Ehlmy9GdDMss9ETPKn2Qn8qQTsjIJypD0oPyYGA3yOYAaYocfaHZgprG8AjmwkXUXBz0 9hFcd96nuhM39r1H61OBNjJYqKcTBajiKrZ+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OLOIhAALAcSrRbS5r3bPdImQRIMt1Znibp//4bnXbDU=; b=Rvps33kQggcULBEuEtJh6cj6WbMbYiKpjQoCfDW20yx+U2sKBF5/8BMeSGw9MUMMUQ ukE+OcUw1sk3PYqyCre0jSmYi4dTH8YGxKsnuWex9hCM5ye16cdDIK8hMmPJngzhHHnV kKAL1slEgOSjouYGbLRMLHwVDSjUCD8Sj4zT+ZaLWfK81o+gsdtKR6b7vs58lDrJdBkA 2HJTsL9C7Q0PNKYPhvHXy/FSYfct1BHAMYLmeB3ss/gn3hsdVveWgsseqMxipPxJTBnx fwzCPHFtrJSoJzZ/4TphhXaW21M78t3HmMZiYOlx5I5tHny5m1kM8wpz8HeqYOZK9Kly oltA== X-Gm-Message-State: AElRT7FqIBrLOwIACV4pAY8Zf/Ra2zYXyAFuPGhvfbNol9M7nmOAHDGc x113kSN9IVp2fjK3H3Q9QEt0KQ== X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr2795536ple.0.1520706030376; Sat, 10 Mar 2018 10:20:30 -0800 (PST) Received: from brienza-desktop.8.8.4.4 (andxu.ucsd.edu. [132.239.17.134]) by smtp.gmail.com with ESMTPSA id h80sm9210167pfj.181.2018.03.10.10.20.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Mar 2018 10:20:29 -0800 (PST) From: Andiry Xu To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Cc: dan.j.williams@intel.com, andy.rudoff@intel.com, coughlan@redhat.com, swanson@cs.ucsd.edu, david@fromorbit.com, jack@suse.com, swhiteho@redhat.com, miklos@szeredi.hu, andiry.xu@gmail.com, Andiry Xu Subject: [RFC v2 12/83] Add timing for mount and init. Date: Sat, 10 Mar 2018 10:17:53 -0800 Message-Id: <1520705944-6723-13-git-send-email-jix024@eng.ucsd.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520705944-6723-1-git-send-email-jix024@eng.ucsd.edu> References: <1520705944-6723-1-git-send-email-jix024@eng.ucsd.edu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/super.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/fs/nova/super.c b/fs/nova/super.c index 9295d23..3efb560 100644 --- a/fs/nova/super.c +++ b/fs/nova/super.c @@ -347,6 +347,9 @@ static struct nova_inode *nova_init(struct super_block *sb, struct nova_inode *root_i, *pi; struct nova_super_block *super; struct nova_sb_info *sbi = NOVA_SB(sb); + timing_t init_time; + + NOVA_START_TIMING(new_init_t, init_time); nova_info("creating an empty nova of size %lu\n", size); sbi->num_blocks = ((unsigned long)(size) >> PAGE_SHIFT); @@ -357,6 +360,7 @@ static struct nova_inode *nova_init(struct super_block *sb, if (!nova_check_size(sb, size)) { nova_warn("Specified NOVA size too small 0x%lx.\n", size); + NOVA_END_TIMING(new_init_t, init_time); return ERR_PTR(-EINVAL); } @@ -399,6 +403,7 @@ static struct nova_inode *nova_init(struct super_block *sb, PERSISTENT_MARK(); PERSISTENT_BARRIER(); nova_info("NOVA initialization finish\n"); + NOVA_END_TIMING(new_init_t, init_time); return root_i; } @@ -473,15 +478,22 @@ static int nova_fill_super(struct super_block *sb, void *data, int silent) unsigned long blocksize; u32 random = 0; int retval = -EINVAL; + timing_t mount_time; + + NOVA_START_TIMING(mount_t, mount_time); BUILD_BUG_ON(sizeof(struct nova_super_block) > NOVA_SB_SIZE); sbi = kzalloc(sizeof(struct nova_sb_info), GFP_KERNEL); - if (!sbi) + if (!sbi) { + NOVA_END_TIMING(mount_t, mount_time); return -ENOMEM; + } + sbi->nova_sb = kzalloc(sizeof(struct nova_super_block), GFP_KERNEL); if (!sbi->nova_sb) { kfree(sbi); + NOVA_END_TIMING(mount_t, mount_time); return -ENOMEM; } @@ -591,6 +603,7 @@ static int nova_fill_super(struct super_block *sb, void *data, int silent) nova_update_mount_time(sb); retval = 0; + NOVA_END_TIMING(mount_t, mount_time); return retval; out: @@ -600,6 +613,7 @@ static int nova_fill_super(struct super_block *sb, void *data, int silent) kfree(sbi->nova_sb); kfree(sbi); nova_dbg("%s failed: return %d\n", __func__, retval); + NOVA_END_TIMING(mount_t, mount_time); return retval; } @@ -701,6 +715,9 @@ static struct file_system_type nova_fs_type = { static int __init init_nova_fs(void) { int rc = 0; + timing_t init_time; + + NOVA_START_TIMING(init_t, init_time); nova_dbg("%s: %d cpus online\n", __func__, num_online_cpus()); if (arch_has_clwb()) @@ -711,17 +728,19 @@ static int __init init_nova_fs(void) rc = init_inodecache(); if (rc) - return rc; + goto out; rc = register_filesystem(&nova_fs_type); if (rc) goto out1; +out: + NOVA_END_TIMING(init_t, init_time); return rc; out1: destroy_inodecache(); - return rc; + goto out; } static void __exit exit_nova_fs(void) -- 2.7.4