Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1837292pxj; Sat, 22 May 2021 03:24:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXKF6rd7O/3Rg5reV6cxp7bCdq9FGn0Vp0y+gwsKd+7jm3Cd+thUXRiY0BCq2PpA9i6JYQ X-Received: by 2002:a92:c60c:: with SMTP id p12mr4997711ilm.116.1621679056288; Sat, 22 May 2021 03:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621679056; cv=none; d=google.com; s=arc-20160816; b=1KL39QsOc1AnQ5CfAxs2hGXhY0KQbIm+JxgNcwLox+38NjTHl5P+vPCZF+69x0QoxF PasLWW87WKqOCms5AZg+ZPe4G4KkKSIXrDa5spPtzBygHP+xpQtvZieqodO767VaCwQB t7JLqENJK8DUZo4voyLd4w0JaOkC347iDhtdwQ+R7NRBfRBB7Tx1w1W11/Dr78Gynnk+ 1bbgi17NjovDhLuB9s/2t4QEAvqqq3lhAX0wayw7vCeC+pFlsJ9XtIuoCTZ+tSz7UF+n SKReMXk6CCxbM8N0puYOhzi6QinCaRbk37doHcAfIQz/d7DZy7H3Vl6AQOIN3dGuycaJ RfLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LQE+ch8riB0o+2pJKpZw/W7gIQAf22uO5uoGFLjtgsQ=; b=pROg0gCUGk+AGaDgGIL1P1AByFqYygMiDIqGJn1UeQVJp5F91PsJhq/WFXoVkwyj1Q 7J9t8dhHFHBLVU4W7dU9/hS4fIiYts6JIlbuncKNWq1fMBuxf+z8AbRqjw3HYfQZ2z23 GFPkNAIJNZHO9D3JHGi1NhqedDBuRNcPE9v/tL3OnYxh5yM1pSOw0LRNfDm9vlb4C7Dz V4AEqtoKb4H5xdvJ7TUH2rdrDnT/CTTTi8zW/zJA0RsoXfqhdrNj0t/V7f4Kx1iA25k5 Yr9nqO5X/y4pN7is6heAOnUFx8hanD4CEur0GA3SDiXdTFrHM3bwTJ+MvxL5/ma6teqB +Iyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si8436826jat.63.2021.05.22.03.24.03; Sat, 22 May 2021 03:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbhEVKWl (ORCPT + 99 others); Sat, 22 May 2021 06:22:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5735 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbhEVKWk (ORCPT ); Sat, 22 May 2021 06:22:40 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FnKD63zqNzqV3p; Sat, 22 May 2021 18:17:42 +0800 (CST) Received: from dggeme752-chm.china.huawei.com (10.3.19.98) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Sat, 22 May 2021 18:21:15 +0800 Received: from huawei.com (10.175.127.227) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 22 May 2021 18:21:14 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Date: Sat, 22 May 2021 18:30:45 +0800 Message-ID: <20210522103045.690103-3-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210522103045.690103-1-yi.zhang@huawei.com> References: <20210522103045.690103-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeme752-chm.china.huawei.com (10.3.19.98) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The cache_cnt parameter of tracepoint ext4_es_shrink_exit means the remaining cache count after shrink, but now it is the cache count before shrink, fix it by read sbi->s_extent_cache_cnt again. Fixes: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API") Cc: stable@vger.kernel.org # 3.12+ Signed-off-by: Zhang Yi --- fs/ext4/extents_status.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index db3cd70a72e4..9a3a8996aacf 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c @@ -1576,6 +1576,7 @@ static unsigned long ext4_es_scan(struct shrinker *shrink, nr_shrunk = __es_shrink(sbi, nr_to_scan, NULL); + ret = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt); trace_ext4_es_shrink_scan_exit(sbi->s_sb, nr_shrunk, ret); return nr_shrunk; } -- 2.25.4