Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3275240pxj; Mon, 24 May 2021 02:54:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztO3lv9fT52xD82YCEHEr+JgWxHrBnZzcgeFMvC4NuPz/yV+Yz760ANj3A3nQ07N4ic3LR X-Received: by 2002:a17:906:4088:: with SMTP id u8mr22118449ejj.240.1621850079968; Mon, 24 May 2021 02:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621850079; cv=none; d=google.com; s=arc-20160816; b=koPBIQkiFp6OnXYjKCaO0nhIhIoJTAPKssOpma4LrynsWEcKMb0g8aq6qm2U+CDt0z u9I4HHWnGq55Yma6f7vWKgLdASBC1Hq6nGWWWCL4KwjH5yjmVWPnrcMBg2qtPEU/H/f2 HCE+SABEIXQdxf/YA/GhMoQea84+diqZVncU2NoZZFzfnJK0f/toRaUWjJ3h9CA8/Tu6 8A6kuKMmdW+BIofYbtiDTnvHLxzltHxmmULprGS1cLzljjn4QHHP3IdFRhq2YNX7kuv3 yBMXnl7m3u4wlSkcq5vlENHwFhjJoY8BQTwe8xzfezDOuubc2lpCwMDQH6SctVVZjgpJ lfnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=Nd9KlTubE21KSPSGULr1+2oPHWFu3hMy3W9SEQvRuGE=; b=aCCzdd5rmaNGvWIH18YAzBddp76LGejOdUV9UunbXYZ56DOVmnbC73d0+ZOirhlK+U 4isNpix5qXxBv8yUXUJ4E/Zd+FkjhEs0HOWiFxoumcLGonIxlndqHcSr99fYC09AzAVG nGqAQFc7wuoFry81aTvd0NF8gP33FL0U0761JIG2qliTw78sikQ0wa7w2QcDD0jGEUE9 /zsAvOj60BMvHptibg4CWQRYlKcJxjPE3KAjGn+FSK/2WL7DTgYIiH9JyYDq3x3npWeB dFQVxNWQptWBdzg43k0CxV/7hY+F4lZMuyPE8MzFX4FUeyEugpcr8mpFHqGEApeZlaYK G9rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WVJ9B5+T; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Cz1RQijW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id da8si12914388edb.398.2021.05.24.02.54.14; Mon, 24 May 2021 02:54:39 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WVJ9B5+T; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=Cz1RQijW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbhEXJzk (ORCPT + 99 others); Mon, 24 May 2021 05:55:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:37488 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbhEXJzk (ORCPT ); Mon, 24 May 2021 05:55:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1621850052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nd9KlTubE21KSPSGULr1+2oPHWFu3hMy3W9SEQvRuGE=; b=WVJ9B5+Th5T147R0t0PBGe70XdJWFxN4kGznQWqT3YhFTqW9y6++XcECGxlOOqhGeiXAGO +kjyoJbY/w/yG32npSmzHeaAd4a2mq7V5jugqDyKJRG1limZ69Yvm5xV2fOETMgAW8NR5W KbLWFrau2Tvewhf885PApaHm9L69sCM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1621850052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nd9KlTubE21KSPSGULr1+2oPHWFu3hMy3W9SEQvRuGE=; b=Cz1RQijWEgfNbk2ygJnMeK1jGhZ9xisV8RsuwkzahJ7mypXWhf/EGPu56zGQJ0sfUgR5du 51BlyHKdFQFGtwAg== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E65B2ABB1; Mon, 24 May 2021 09:54:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7701A1F2CA2; Mon, 24 May 2021 11:54:11 +0200 (CEST) Date: Mon, 24 May 2021 11:54:11 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yukuai3@huawei.com Subject: Re: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Message-ID: <20210524095411.GH32705@quack2.suse.cz> References: <20210522103045.690103-1-yi.zhang@huawei.com> <20210522103045.690103-3-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210522103045.690103-3-yi.zhang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 22-05-21 18:30:45, Zhang Yi wrote: > 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 Yeah, probably it is better this way. Feel free to add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR