[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210527062148.9361-21-songmuchun@bytedance.com>
Date: Thu, 27 May 2021 14:21:47 +0800
From: Muchun Song <songmuchun@...edance.com>
To: willy@...radead.org, akpm@...ux-foundation.org, hannes@...xchg.org,
mhocko@...nel.org, vdavydov.dev@...il.com, shakeelb@...gle.com,
guro@...com, shy828301@...il.com, alexs@...nel.org,
richard.weiyang@...il.com, david@...morbit.com,
trond.myklebust@...merspace.com, anna.schumaker@...app.com
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-nfs@...r.kernel.org,
zhengqi.arch@...edance.com, duanxiongchun@...edance.com,
fam.zheng@...edance.com, Muchun Song <songmuchun@...edance.com>
Subject: [PATCH v2 20/21] mm: list_lru: rename list_lru_per_memcg to list_lru_memcg
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 <songmuchun@...edance.com>
---
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 d7c9bd29e836..7497719ec71c 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 37052864bf78..77efdd0c8b24 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;
}
@@ -304,7 +304,7 @@ unsigned long list_lru_walk_node(struct list_lru *lru, int nid,
isolated += list_lru_walk_one(lru, nid, NULL, isolate, cb_arg,
nr_to_walk);
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) {
@@ -331,10 +331,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)
@@ -348,7 +348,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.
@@ -378,7 +378,7 @@ static int 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;
@@ -483,7 +483,7 @@ int list_lru_memcg_alloc(struct list_lru *lru, struct mem_cgroup *memcg, gfp_t g
int i, ret = 0;
struct list_lru_memcg_table {
- struct list_lru_per_memcg *mlru;
+ struct list_lru_memcg *mlru;
struct mem_cgroup *memcg;
} *table;
@@ -494,7 +494,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.
*/
@@ -506,7 +506,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))
@@ -525,7 +525,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:
--
2.11.0
Powered by blists - more mailing lists