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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67AABC74A5B for ; Wed, 29 Mar 2023 11:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229672AbjC2L5J (ORCPT ); Wed, 29 Mar 2023 07:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjC2L5H (ORCPT ); Wed, 29 Mar 2023 07:57:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2826A4C33; Wed, 29 Mar 2023 04:56:37 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3DF99219D6; Wed, 29 Mar 2023 11:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680090965; 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=MgoqW9i5PP+a88cpUieall/Y5VXNVR+ZmdLSTwQcCUk=; b=gPDY7Zoa+PX03ws7DqJY76AlRsJnW8njixlmMYQFSry0Sm7LYXBffaSrEiEddrRh93lQ4b ta0+tMP2rFqm3q5t+9Dfe+XUHMrnimp8Y7siBb2qRrh+CyK+th4RsUG//OZ8FQ4e5R54q8 ObR9oKGkhhZrGoyU+nMqPxNH4q//bhU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CAA5138FF; Wed, 29 Mar 2023 11:56:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KZZ/ClUnJGSOXQAAMHmgww (envelope-from ); Wed, 29 Mar 2023 11:56:05 +0000 Date: Wed, 29 Mar 2023 13:56:04 +0200 From: Michal Hocko To: Yosry Ahmed Cc: Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Johannes Weiner , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Michal =?iso-8859-1?Q?Koutn=FD?= , Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org Subject: Re: [PATCH v2 2/9] memcg: rename mem_cgroup_flush_stats_"delayed" to "ratelimited" Message-ID: References: <20230328221644.803272-1-yosryahmed@google.com> <20230328221644.803272-3-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230328221644.803272-3-yosryahmed@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 28-03-23 22:16:37, Yosry Ahmed wrote: > mem_cgroup_flush_stats_delayed() suggests his is using a delayed_work, > but this is actually sometimes flushing directly from the callsite. > > What it's doing is ratelimited calls. A better name would be > mem_cgroup_flush_stats_ratelimited(). > > Suggested-by: Johannes Weiner > Signed-off-by: Yosry Ahmed > Acked-by: Shakeel Butt > Acked-by: Johannes Weiner Acked-by: Michal Hocko > --- > include/linux/memcontrol.h | 4 ++-- > mm/memcontrol.c | 2 +- > mm/workingset.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index b6eda2ab205d..ac3f3b3a45e2 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -1037,7 +1037,7 @@ static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, > } > > void mem_cgroup_flush_stats(void); > -void mem_cgroup_flush_stats_delayed(void); > +void mem_cgroup_flush_stats_ratelimited(void); > > void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > int val); > @@ -1535,7 +1535,7 @@ static inline void mem_cgroup_flush_stats(void) > { > } > > -static inline void mem_cgroup_flush_stats_delayed(void) > +static inline void mem_cgroup_flush_stats_ratelimited(void) > { > } > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 0205e58ea430..c3b6aae78901 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -653,7 +653,7 @@ void mem_cgroup_flush_stats(void) > __mem_cgroup_flush_stats(); > } > > -void mem_cgroup_flush_stats_delayed(void) > +void mem_cgroup_flush_stats_ratelimited(void) > { > if (time_after64(jiffies_64, flush_next_time)) > mem_cgroup_flush_stats(); > diff --git a/mm/workingset.c b/mm/workingset.c > index 00c6f4d9d9be..af862c6738c3 100644 > --- a/mm/workingset.c > +++ b/mm/workingset.c > @@ -462,7 +462,7 @@ void workingset_refault(struct folio *folio, void *shadow) > > mod_lruvec_state(lruvec, WORKINGSET_REFAULT_BASE + file, nr); > > - mem_cgroup_flush_stats_delayed(); > + mem_cgroup_flush_stats_ratelimited(); > /* > * Compare the distance to the existing workingset size. We > * don't activate pages that couldn't stay resident even if > -- > 2.40.0.348.gf938b09366-goog -- Michal Hocko SUSE Labs