From patchwork Sat Mar 10 18:17:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andiry Xu X-Patchwork-Id: 10273829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E25B601A0 for ; Sat, 10 Mar 2018 18:20:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C05A28BAE for ; Sat, 10 Mar 2018 18:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80D0B293FC; Sat, 10 Mar 2018 18:20:34 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4576428BAE for ; Sat, 10 Mar 2018 18:20:34 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5362A2258AEFE; Sat, 10 Mar 2018 10:14:15 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::244; helo=mail-pl0-x244.google.com; envelope-from=jix024@eng.ucsd.edu; receiver=linux-nvdimm@lists.01.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DCB912258AEFB for ; Sat, 10 Mar 2018 10:14:11 -0800 (PST) Received: by mail-pl0-x244.google.com with SMTP id u13-v6so7031217plq.1 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=msCm7IVSlRcsM6XQoov7wRKzE5W0d0xscyhK40ZpOHfvSDbNIHkNGOMELL58WIh03I 6PRgeCWso0vAsrplUHJ7NVLcAPlao/Li03Gv5fBSMcSwOdaWMLwJhuHfWcRMYcoGmusA pCm34p36afVa77djSPekrnl+BzLpuMHiYNI7nnJFhd2+3VbnYuqM5O93AA43S/Brm+7h FtOR5uX4kVBSZH82voiA9SNLQOIsuCQCWK8tvJOI8Ohfmzrpv2MsD7nnpcZHBa0jqYBV A5JT3KmQ6IhybCnMT/vRyfxSOoF7hPkCv60KDolapR+SQ8GX9gz8tTVKHm7j2yC0stqB xYqQ== X-Gm-Message-State: AElRT7GkocKAycKMYldxL5ZXo9CEhRtd9eQYnN0Z9cWDaNenPyxn848Y COh1JZxpYhUfJOZm6BNQ395Yrg== X-Google-Smtp-Source: AG47ELtW5kq5E8kWAoShZI9KIDZrbQJS2hZ1SubjjMPCYIXnMfghYatQ+mtO5glfniRibrK/OMF18Q== 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 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> X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coughlan@redhat.com, miklos@szeredi.hu, Andiry Xu , david@fromorbit.com, jack@suse.com, swanson@cs.ucsd.edu, swhiteho@redhat.com, andiry.xu@gmail.com MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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)