From patchwork Tue Sep 14 07:29:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12492239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 084EFC433F5 for ; Tue, 14 Sep 2021 07:41:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD1EE60F70 for ; Tue, 14 Sep 2021 07:41:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD1EE60F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 521D1940023; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D1A7940007; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 399B2940023; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 2AB38940007 for ; Tue, 14 Sep 2021 03:41:56 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E28BA2B36E for ; Tue, 14 Sep 2021 07:41:55 +0000 (UTC) X-FDA: 78585384990.12.B8C6152 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf13.hostedemail.com (Postfix) with ESMTP id AB049102E516 for ; Tue, 14 Sep 2021 07:41:55 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so1460089pjc.3 for ; Tue, 14 Sep 2021 00:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uSAYuhOyann2TYu2BTLW7Gh2GVVnTWM86+XGXivlMaI=; b=RjdpnwuZYCntSc2k5Rp9Zx731FWalvTUA4/EVgheivP6nkFjljjrIAA+dnk+yGBWcV 7BAOAkK3M032Ow0n4G1tYHQ6EpH5PxkTcfLDV6d/Jd6kD2VzfvtAmYTJCpdu/yyqTsdL 7YKM/5D7ol1TY3tqUaj967frvkZYXxgdGQ/m3tayT79s8ZIw6Qxr4TkeqmUTij+ICSRC ouoo34le5ARMxk2v6MeKQdJu61ALZb3IwujZ0AQOxJgjHkKq8nVx5Qah3Gi8bPeaYlB9 /I0RdqovHxgW/13VCn+0pG8ByT7yBRcecKun3z+OVZJQUl33KATYfAcW71RnjFjXCwb2 sCMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uSAYuhOyann2TYu2BTLW7Gh2GVVnTWM86+XGXivlMaI=; b=rrPX/tTX6I9MNcfXAtRPm1JUYfzxBiIQa1Ehb99mhJpXwsIbWYHLzNP/A1mGlqQmmU peOqJmqqwk7XtAIMZMSsaSz/VGswXh24Rjn70w3syJS+wyLOWPWMs9VSwXP61IxrDS8G hvcNk0rA4EzAj7mxl1s3nnlyB6IO3JLc6RDigMUfPO4nnONCfZLGL2EYF6tzNryy+W1X QrEOnMpbVT8mot15Sgvnbxfq3mgvtC2qqb8dNiiK/20rX0niRdG9ofrjpPHMMrXMLvMe IqNkhZuSOOUoOFsU1hxuIiB3G7CL7nEO5QOSByxO4RkkOjhh7VKh+mrmBhXwTJNyZpv4 OGTw== X-Gm-Message-State: AOAM5322s6DF8lGy4Ed+X62kECyYGdxbmTh5RNG2JpsfNNRyewr0nkNM aipqOJLfXFqOPZ2CZgn7vTnH/A== X-Google-Smtp-Source: ABdhPJzZ/+akkmlZcbuRVLuFo7kw7adZkfup1RQUhnKbZBRJAiX9R8j05PAQA34sU2tGS+Roa9MW9w== X-Received: by 2002:a17:90a:1c81:: with SMTP id t1mr577065pjt.170.1631605314870; Tue, 14 Sep 2021 00:41:54 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id s3sm9377839pfd.188.2021.09.14.00.41.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 00:41:54 -0700 (PDT) From: Muchun Song To: willy@infradead.org, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, shakeelb@google.com, guro@fb.com, shy828301@gmail.com, alexs@kernel.org, richard.weiyang@gmail.com, david@fromorbit.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, zhengqi.arch@bytedance.com, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v3 75/76] mm: list_lru: rename list_lru_per_memcg to list_lru_memcg Date: Tue, 14 Sep 2021 15:29:37 +0800 Message-Id: <20210914072938.6440-76-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210914072938.6440-1-songmuchun@bytedance.com> References: <20210914072938.6440-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Stat-Signature: sxpkesmeg7ywnwaosagp8cwgr6yyptoe Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=RjdpnwuZ; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf13.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AB049102E516 X-HE-Tag: 1631605315-414023 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: Before now, the name of list_lru_memcg was occupied. Since previous patch, the name is free. So rename list_lru_per_memcg to list_lru_memcg, it is more brief. Signed-off-by: Muchun Song --- include/linux/list_lru.h | 2 +- mm/list_lru.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index c423be3cf2d3..d654c8e3d262 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -32,7 +32,7 @@ struct list_lru_one { long nr_items; }; -struct list_lru_per_memcg { +struct list_lru_memcg { struct rcu_head rcu; /* array of per cgroup per node lists, indexed by node id */ struct list_lru_one nodes[]; diff --git a/mm/list_lru.c b/mm/list_lru.c index 1202519aeb31..371097ee2485 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -52,7 +52,7 @@ static inline struct list_lru_one * list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { if (list_lru_memcg_aware(lru) && idx >= 0) { - struct list_lru_per_memcg *mlru = xa_load(&lru->xa, idx); + struct list_lru_memcg *mlru = xa_load(&lru->xa, idx); return mlru ? &mlru->nodes[nid] : NULL; } @@ -306,7 +306,7 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid, #ifdef CONFIG_MEMCG_KMEM if (*nr_to_walk > 0 && list_lru_memcg_aware(lru)) { - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; unsigned long index; xa_for_each(&lru->xa, index, mlru) { @@ -335,10 +335,10 @@ static void init_one_lru(struct list_lru_one *l) } #ifdef CONFIG_MEMCG_KMEM -static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) +static struct list_lru_memcg *memcg_list_lru_alloc(gfp_t gfp) { int nid; - struct list_lru_per_memcg *lru; + struct list_lru_memcg *lru; lru = kmalloc(struct_size(lru, nodes, nr_node_ids), gfp); if (!lru) @@ -352,7 +352,7 @@ static struct list_lru_per_memcg *memcg_list_lru_alloc(gfp_t gfp) static void memcg_list_lru_free(struct list_lru *lru, int src_idx) { - struct list_lru_per_memcg *mlru = xa_erase_irq(&lru->xa, src_idx); + struct list_lru_memcg *mlru = xa_erase_irq(&lru->xa, src_idx); /* * The __list_lru_walk_one() can walk the list of this node. @@ -374,7 +374,7 @@ static void memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) static void memcg_destroy_list_lru(struct list_lru *lru) { XA_STATE(xas, &lru->xa, 0); - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; if (!list_lru_memcg_aware(lru)) return; @@ -477,7 +477,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g int i; struct list_lru_memcg_table { - struct list_lru_per_memcg *mlru; + struct list_lru_memcg *mlru; struct mem_cgroup *memcg; } *table; @@ -488,7 +488,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g return 0; /* - * The allocated list_lru_per_memcg array is not accounted directly. + * The allocated list_lru_memcg array is not accounted directly. * Moreover, it should not come from DMA buffer and is not readily * reclaimable. So those GFP bits should be masked off. */ @@ -500,7 +500,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g /* * Because the list_lru can be reparented to the parent cgroup's * list_lru, we should make sure that this cgroup and all its - * ancestors have allocated list_lru_per_memcg. + * ancestors have allocated list_lru_memcg. */ for (i = 0; memcg; memcg = parent_mem_cgroup(memcg), i++) { if (memcg_list_lru_skip_alloc(lru, memcg)) @@ -519,7 +519,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g xas_lock_irqsave(&xas, flags); while (i--) { int index = memcg_cache_id(table[i].memcg); - struct list_lru_per_memcg *mlru = table[i].mlru; + struct list_lru_memcg *mlru = table[i].mlru; xas_set(&xas, index); retry: