mm/memcg: Remove soft_limit_tree_node()

Opencode this one-line function in its three callers.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent 658b69c9
...@@ -456,12 +456,6 @@ ino_t page_cgroup_ino(struct page *page) ...@@ -456,12 +456,6 @@ ino_t page_cgroup_ino(struct page *page)
return ino; return ino;
} }
static struct mem_cgroup_tree_per_node *
soft_limit_tree_node(int nid)
{
return soft_limit_tree.rb_tree_per_node[nid];
}
static void __mem_cgroup_insert_exceeded(struct mem_cgroup_per_node *mz, static void __mem_cgroup_insert_exceeded(struct mem_cgroup_per_node *mz,
struct mem_cgroup_tree_per_node *mctz, struct mem_cgroup_tree_per_node *mctz,
unsigned long new_usage_in_excess) unsigned long new_usage_in_excess)
...@@ -538,7 +532,7 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) ...@@ -538,7 +532,7 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid)
struct mem_cgroup_per_node *mz; struct mem_cgroup_per_node *mz;
struct mem_cgroup_tree_per_node *mctz; struct mem_cgroup_tree_per_node *mctz;
mctz = soft_limit_tree_node(nid); mctz = soft_limit_tree.rb_tree_per_node[nid];
if (!mctz) if (!mctz)
return; return;
/* /*
...@@ -577,7 +571,7 @@ static void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg) ...@@ -577,7 +571,7 @@ static void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg)
for_each_node(nid) { for_each_node(nid) {
mz = memcg->nodeinfo[nid]; mz = memcg->nodeinfo[nid];
mctz = soft_limit_tree_node(nid); mctz = soft_limit_tree.rb_tree_per_node[nid];
if (mctz) if (mctz)
mem_cgroup_remove_exceeded(mz, mctz); mem_cgroup_remove_exceeded(mz, mctz);
} }
...@@ -3364,7 +3358,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, ...@@ -3364,7 +3358,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
if (order > 0) if (order > 0)
return 0; return 0;
mctz = soft_limit_tree_node(pgdat->node_id); mctz = soft_limit_tree.rb_tree_per_node[pgdat->node_id];
/* /*
* Do not even bother to check the largest node if the root * Do not even bother to check the largest node if the root
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment