From patchwork Thu Mar 30 19:17:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13194752 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 C7259C77B71 for ; Thu, 30 Mar 2023 19:18:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31F656B0074; Thu, 30 Mar 2023 15:18:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 273FA900004; Thu, 30 Mar 2023 15:18:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0ED466B007B; Thu, 30 Mar 2023 15:18:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id F0BAE6B0074 for ; Thu, 30 Mar 2023 15:18:10 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7A7F4AC957 for ; Thu, 30 Mar 2023 19:18:10 +0000 (UTC) X-FDA: 80626525140.04.58E2655 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf10.hostedemail.com (Postfix) with ESMTP id 92C0EC000E for ; Thu, 30 Mar 2023 19:18:08 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QmYQM+j1; spf=pass (imf10.hostedemail.com: domain of 3b-AlZAoKCO4oeihoQXcUTWeeWbU.SecbYdkn-ccalQSa.ehW@flex--yosryahmed.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3b-AlZAoKCO4oeihoQXcUTWeeWbU.SecbYdkn-ccalQSa.ehW@flex--yosryahmed.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680203888; a=rsa-sha256; cv=none; b=KLyIJnv87/3+CxrjtToaxG9DoPxqs4LDi/XvLY3Zsp3Dp+LhuogDaDBXWRf4cbBGt0Mixi OPMNa0R79hsLFPJaL7n6A5XUW91apVSIOPXE4y4zo6rp8kgyuUSECv5quoOaqHZ8dNi/mo o38bhC+SaPQZdDY1+63SJmLXqzH9qj4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QmYQM+j1; spf=pass (imf10.hostedemail.com: domain of 3b-AlZAoKCO4oeihoQXcUTWeeWbU.SecbYdkn-ccalQSa.ehW@flex--yosryahmed.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3b-AlZAoKCO4oeihoQXcUTWeeWbU.SecbYdkn-ccalQSa.ehW@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=1680203888; 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=LXlZsArwPDY7OuU2BxzeoXG1UXSoglEAfUQ5EzzMXG4=; b=wa9kXfwIQc9FnTprlPYPlfyyTPq4FAWGqbviLztbYKvFtqVciTNjfBYfZA55rBshbOc9GB MaUwc+3IagWP4ahL337RSmbL2GvsAQd1xbcxNHJo5vbSLvNbpqeeK51Y0gstIEhocymHBe IbKQVMVR0Auw68Dm4NVp4aY1Ujd+dbs= Received: by mail-pl1-f201.google.com with SMTP id z14-20020a170903018e00b001a1a2bee58dso11594082plg.3 for ; Thu, 30 Mar 2023 12:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680203887; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=LXlZsArwPDY7OuU2BxzeoXG1UXSoglEAfUQ5EzzMXG4=; b=QmYQM+j13cdbjBiZy3Y+dzkJUgGOVHTdr9lvDbSE859fYaJtq+8zmH02RDaKbdpvap CqejHKuoW/4IBz5mIHOf6Y8AHa6GMb/hCZ7zMABh1AePaLkgpcjAyzU7xGg8rQCDHyuT xd/GhSCAHuv9H/zwirCUR2wyGX+B6mkWwB9WVRwD19bK9qyHzg7+GCXy42vkNiRXXZdr kN4hOyhVE2VLeXDBEBRHB8fSA0RE0BkgU+jq32E4Jq+3xIhGwrpX/kGZ92PdxYBPFxyB 8OgXFYA1yB1rgGnRYxUqB9CL2/ZWFsevIT5f1UxupCOTzAHu4BNZEW/BqlkhNKD16qxi CoQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680203887; 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=LXlZsArwPDY7OuU2BxzeoXG1UXSoglEAfUQ5EzzMXG4=; b=UgMOcJBTavaK42IzACau6kbGeqWq+Lh/TZeK+SLPdvh518cY2rz44V2i8hCQrD1PcI 3TiCNrUjCw0eDv6/RtJBN5MefqOZCTXwamoMgLDw89UAhSFY3+nXAbQlBumZ3cajYS5D mQaZMPzRABanfsPnBobEJ0xkKy9sZCNgvj5BAsJ7RMkKwPiKSGffWDiFiA8lpBMX9uz1 lIotCTEX5dukTC1RNPbP07Xu9vV3ONsm9vAkn4SEdqXXPqanJF50zCp/x3lyuBR9euQ9 WmDbNdlEuqoFALQ/7BljaispSvkDu+dtNqFi7tooMKQWPQwWW3KR4DnX74NO09Canzq6 wPiA== X-Gm-Message-State: AAQBX9dA1H9xxfryIf0rupzvZsi3w60aIDWPyjmURMuau3LNXOy8TG1m 8E8MDX45J/e3c/m/HmLp6MFVwu7j0P1Fd52w X-Google-Smtp-Source: AKy350acDpkb2oKWRJtDPrvhJr6G7w3aWGLRFehCl/mgbnA6nqxhni7pGTt+2Eb5S7HVMulqi96jSmdvt00VgGJt X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a17:90a:ec11:b0:237:9cbe:22ad with SMTP id l17-20020a17090aec1100b002379cbe22admr7641616pjy.5.1680203887352; Thu, 30 Mar 2023 12:18:07 -0700 (PDT) Date: Thu, 30 Mar 2023 19:17:55 +0000 In-Reply-To: <20230330191801.1967435-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230330191801.1967435-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230330191801.1967435-3-yosryahmed@google.com> Subject: [PATCH v3 2/8] 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 , Michal Hocko X-Rspam-User: X-Rspamd-Queue-Id: 92C0EC000E X-Rspamd-Server: rspam01 X-Stat-Signature: 854euski8y4h7w1m9abe47zm9u8r7jdm X-HE-Tag: 1680203888-253626 X-HE-Meta: U2FsdGVkX1/vwKFF1V5Ke330zjdtN0xK2XsAkskz4rSQ3O2ayZNIJgGVBagMBjijPd9eCpZ1b/3fmVXPQxk/SK4Q+ZoVQytFlj3Oh84ekPDiHwWHYIaJd+TDfE4IRosJ3+fxmDuny2shcHGbxErZPKPLol7gw+PT6oP1a4G7XXRpgMM+PfrUJU9+c91YFDXign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Ov3RnD1B4HO5yjaPmyoBokiwdOHINRKLa0CYZGuONeSxRaZKzzvkBGr3NeDnrgHwZ3gd+yjdrEPF7ZaWcYovT26ehc3MdDaZVRMq7vSoP4tZlt31R4TBZlHgJPtKObq+rf+kcIZYzMIshDOH6R6e9hXUidp4UjG/iOc0LB27N4Phu/uvVLSTwxdyH9yHM0PcuQRyIHTWkf1fvO+F8aM+Qj6PaXQWJoVbUy+bJgs6YbjgXBGu4/Z5lVxu2m4abtxT7MXe/eED3MK/t2C/8gk/oTaHGILP0SFaDwxsDzOmLwYwslkTgPoRPkC+Rop39nK1EygctEtie+d2l3FTDWhmhIDhZakUxkGsOrCNKUOw7sHLvjXkqJPgNZvp149R4HE1lcV3j+iAZFfTtfBeNPum966gjCfzHDSfUrVWhLAsnB82rWoReRpSKpFeiKjDTtBNETxrHmHj4BI8IPpXKf3GYlGP1L0GmixpRCgxH89aga+s7lsr/GzSixz5got2+PDISCXfpM2RkTqzn24zjpGQIuQH9nzXSUIi7x8sCJ597aya8LGM2pbGTv7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 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