From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21D37ECAAA1 for ; Tue, 6 Sep 2022 07:14:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oVSnM-0002yC-AQ; Tue, 06 Sep 2022 07:14:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oVSnH-0002xz-8J for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Sep 2022 07:14:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Transfer-Encoding:Content-Type :In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E05FQc5/bq5Nj2RaKQR/u/jwiDTI+f93+Nb++LrDEGA=; b=UqGmwI6tRmE5M9hEVyEdKbfVhy WkVJxr2N/xsGLMfe5bso0/FpObOx1zXInyEu3ojZrt8TKUDpXrg5tBigwS0QkxW9AtFma6fhR3pC+ 4fkT8OPh+XUTWVzECVic1ioCa2pu1vv8EPf2NXh9J5FCSaEOJIDQOGm6nerrJzb1n1eo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Transfer-Encoding:Content-Type:In-Reply-To: References:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=E05FQc5/bq5Nj2RaKQR/u/jwiDTI+f93+Nb++LrDEGA=; b=E1qNNDZ9SYILSCAstXsal4w0U8 1nfdR8FbK1qxXx6HD1fkyB0CAbE7CxOF4QxMzGgLiDA33u1hAgU5zqDzXT+/POs1e5AYPoDS+BQnS fQdLY4QmeG7X6aleRCy/N6eUrL+guY2AhBW7G5XHVDOqAG4d2mwnNQltrBdFWwOqHaXc=; Received: from szxga01-in.huawei.com ([45.249.212.187]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oVSnF-00H2b9-Mh for linux-f2fs-devel@lists.sourceforge.net; Tue, 06 Sep 2022 07:14:47 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MMGm24WXgznVCZ; Tue, 6 Sep 2022 15:12:02 +0800 (CST) Received: from kwepemm600014.china.huawei.com (7.193.23.54) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 6 Sep 2022 15:14:32 +0800 Received: from kwepemm600014.china.huawei.com (7.193.23.54) by kwepemm600014.china.huawei.com (7.193.23.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 6 Sep 2022 15:14:32 +0800 Received: from kwepemm600014.china.huawei.com ([7.193.23.54]) by kwepemm600014.china.huawei.com ([7.193.23.54]) with mapi id 15.01.2375.024; Tue, 6 Sep 2022 15:14:32 +0800 To: Chao Yu , "jaegeuk@kernel.org" Thread-Topic: [PATCH -next] f2fs: total hit count should only be increased when entry found Thread-Index: AQHYwZ4wwW6Jznhtgkmy7JH988GDna3R+zsA Date: Tue, 6 Sep 2022 07:14:32 +0000 Message-ID: References: <20220905141225.26456-1-zhangqilong3@huawei.com> <6813adb8-73c4-0fd7-5ee4-a1d4a97e6552@kernel.org> In-Reply-To: <6813adb8-73c4-0fd7-5ee4-a1d4a97e6552@kernel.org> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.177.246] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Headers-End: 1oVSnF-00H2b9-Mh Subject: [f2fs-dev] =?utf-8?b?562U5aSNOiBbUEFUQ0ggLW5leHRdIGYyZnM6IHRvdGFs?= =?utf-8?q?_hit_count_should_only_be_increased_when_entry_found?= X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: zhangqilong via Linux-f2fs-devel Reply-To: zhangqilong Cc: "linux-f2fs-devel@lists.sourceforge.net" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net > when entry found > > On 2022/9/5 22:12, Zhang Qilong wrote: > > We should not increase total hit count when not found the entry in > > cache extent tree. Remove the stat_inc_total_hit when > > f2fs_lookup_rb_tree returns nullptr. > > Actually, f2fs will account total lookup count into sbi->total_hit_ext. > > Thanks, OK, I get it. The name confused me :). Maybe we could consider changing the names of member variable and function? Like total_access_count or total_lookup_count, etc, just a little suggestion for reference only. Thanks, > > > > > Fixes:54c2258cd63a8 ("f2fs: extract rb-tree operation infrastructure") > > Signed-off-by: Zhang Qilong > > --- > > fs/f2fs/extent_cache.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index > > 866e72b29bd5..264682eebcd1 100644 > > --- a/fs/f2fs/extent_cache.c > > +++ b/fs/f2fs/extent_cache.c > > @@ -426,6 +426,7 @@ static bool f2fs_lookup_extent_tree(struct > inode *inode, pgoff_t pgofs, > > *ei = et->largest; > > ret = true; > > stat_inc_largest_node_hit(sbi); > > + stat_inc_total_hit(sbi); > > goto out; > > } > > > > @@ -447,8 +448,8 @@ static bool f2fs_lookup_extent_tree(struct > inode *inode, pgoff_t pgofs, > > } > > spin_unlock(&sbi->extent_lock); > > ret = true; > > -out: > > stat_inc_total_hit(sbi); > > +out: > > read_unlock(&et->lock); > > > > trace_f2fs_lookup_extent_tree_end(inode, pgofs, ei); _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel