From patchwork Tue Mar 28 06:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13190555 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C49DCC76196 for ; Tue, 28 Mar 2023 06:16:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06F8B900004; Tue, 28 Mar 2023 02:16:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3CE9900003; Tue, 28 Mar 2023 02:16:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D197E900004; Tue, 28 Mar 2023 02:16:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C10DB900003 for ; Tue, 28 Mar 2023 02:16:48 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 953FA160832 for ; Tue, 28 Mar 2023 06:16:48 +0000 (UTC) X-FDA: 80617298496.25.652662F Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf03.hostedemail.com (Postfix) with ESMTP id C90252000F for ; Tue, 28 Mar 2023 06:16:46 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ML25Z5sJ; spf=pass (imf03.hostedemail.com: domain of 3TYYiZAoKCAwA043Amtyqps00sxq.o0yxuz69-yyw7mow.03s@flex--yosryahmed.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3TYYiZAoKCAwA043Amtyqps00sxq.o0yxuz69-yyw7mow.03s@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679984206; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wKfUWPDFjTfCFAmAu+PDSXoVaLfaEZa4F2xpA6M98WI=; b=4AMlDaWGx+Yk1w2hqLkjWNBj8p04pQ0pnhyBkru5ic6BIdaRcnnK202kc75a+5H3/cpe4F mh+FdBEjkQYZv0xo509D8LbJuJ5xPyLU7w+bTXjIjT0W9g5R+/nk7qjaIZkNhdnDy0/wdx mP3/FXN71le5emkUJq42rGCMRPUc/xk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ML25Z5sJ; spf=pass (imf03.hostedemail.com: domain of 3TYYiZAoKCAwA043Amtyqps00sxq.o0yxuz69-yyw7mow.03s@flex--yosryahmed.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3TYYiZAoKCAwA043Amtyqps00sxq.o0yxuz69-yyw7mow.03s@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679984206; a=rsa-sha256; cv=none; b=ZiJ6Mrn1X0B1ZUOur70aWXjidUdOkiDLhP19IleK8RdxsCoFvCHGr+HLo502fFTEDcfOQr 6yGgFJ7kCRGuPnJqNYZNYL5oJadjzqU1sj847YrkdKrJ/FWuPWfy6wInMK/AM01BoGjRLZ VeJtw2dwloZm9dx+gLpdN3cKH/hMKHg= Received: by mail-pj1-f73.google.com with SMTP id q99-20020a17090a1b6c00b0023f0c6c6b3dso2971533pjq.1 for ; Mon, 27 Mar 2023 23:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679984205; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=wKfUWPDFjTfCFAmAu+PDSXoVaLfaEZa4F2xpA6M98WI=; b=ML25Z5sJR8k5t8kSQzNLjGMjEKmdcebxHFtYwKZcrTLZX2wK0gMrUstJ28IAfa/l/B dmJfAqHqeUNGDMqpjHMcUn/3rl6ZtTwoLtJc4kM6PKx7oTSnQD1aK8fu6wcMuvNpddNP JXz/aPGcRNjn7CdP1wNYEAXnpd0Uj2w+rzBilII9bcn8vsNoKap2/emH97XB9yYmQX0j zWlTQgN/LRjTLn7LSTnUMs5Zi8YiSMdP4rhUt8H9KINdPVTgc9z/VX9FnrviFmsMUsqK yY+aBb6I7/+gAXbDQAsJSzcOoGzk7Nj4yOSGJy0Va4z4/Vp/gmfRCs4LrcZySZjB+aj0 I08g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679984205; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wKfUWPDFjTfCFAmAu+PDSXoVaLfaEZa4F2xpA6M98WI=; b=rTMRUAKGKTEVgA7yFF937Hulw7alhS1wpeY6XfyaIN4Syfc4md+lYhG91QLlCTRJS7 /J0nLkWV0o+MSkrXcKEf3uf+vfz84bAIHRPPnBCQBeNZKA5juohBr5NPJsa0KomLkGyk sPkOEZReJeY98lOXnXKT+InuETRRQu0ZNZz1u4xFYIH7BFiW5c3Q8scjWEONTYZv7ggX AXU8rWmMurpa3kJpYpFBnO+OtnML10fwyLlFQczEkNxbn5M3RYOZX8IUzkin9xNOlRGf 7xjSk247ET0k2aYtMZohyeCHH+ZaeoW0WfyUnF/ExJBo+6zOHluee1K5LzzA3JlzSY9t Q45Q== X-Gm-Message-State: AAQBX9cDJgqgQDhBmapNowuAHJnAS/G0LI8Z16qaeJ/QczJt9hI6VfLB ERhjHd22vcX40XE0001ER52etRnfnLIk9LZK X-Google-Smtp-Source: AKy350Z/+j+6P1wMetl7E14Y1prBzO4hFyvwBGRqSlF4uLs1fV1I04aur9Q5rKjp70R1U9RxRmWGSymD4DlPFw5z X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:902:7088:b0:19a:5953:e85c with SMTP id z8-20020a170902708800b0019a5953e85cmr5289230plk.1.1679984205498; Mon, 27 Mar 2023 23:16:45 -0700 (PDT) Date: Tue, 28 Mar 2023 06:16:31 +0000 In-Reply-To: <20230328061638.203420-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230328061638.203420-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230328061638.203420-3-yosryahmed@google.com> Subject: [PATCH v1 2/9] memcg: rename mem_cgroup_flush_stats_"delayed" to "ratelimited" From: Yosry Ahmed To: Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , " =?utf-8?q?Michal_Koutn=C3=BD?= " Cc: Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, Yosry Ahmed X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C90252000F X-Rspam-User: X-Stat-Signature: tboidrn6zwkqctbnzji9jp5ebdhe5tne X-HE-Tag: 1679984206-764095 X-HE-Meta: U2FsdGVkX18qL7xKUuLx6BESReB7ZnAOfmKMiDHhs2Rm+oASY262rZTb0J81qjq27dBk+A1ZKE4+RDP1CSHLjZM5JtqzX3k4n/MQAZI9+AXkAYABNWMRvwPgXzf74MTIjZdtgeeXMPezBqX5MG14pvqqsmv5JQm92UpTrzK38ijidLPEm3i1MTS6QJb5Aeb7W++qq9df4qpT5B1GRBFJYovKJGXG9/JGu+mFxTxtl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lsItVavSXDMIUaGwez3Ud1I8HnmraKz0FaWOjXTqrH34H7F39ttsIGffDRO8lAKYJe/wiaVf45cubSOfxTnQHbI32TfyPfmvWLB1D02apheKQlA2kbiHUZiO5zMCe8TctlKyA2k86hGce7fnjGCF3OE0QtjltmbKIkB7iRz9nyiqjfYEMvKY4T29u8n09gGXmL2syAvGkHOW6Eybya8G3JJxKJPK/XAEjaJjqsUhGCK+fHxkOnIWjxGQMXXpld4IvUjTSiSFppMEYrRoUHQxddeIMtFJmvjnVjDBS8RbP4H9xkgy1z5a5vcUNP0h3fOvFnc7PMQezHiG6HYqyQMpJYzZovueqDN/cOBigCQI/kHLWBNtJAlAUGINtW+lXJcXCQUXTCbcMfyts04Z2wZWyTSuTnacI2Ija4So6Fwtemay1CWB+jEDOSxgYQGqH4p+42IvJy1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000020, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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