Thread (128 messages) 128 messages, 3 authors, 2021-06-28

Re: [PATCH v2 12/46] mm/memcg: Use the node id in mem_cgroup_update_tree()

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-06-23 08:13:27
Also in: linux-fsdevel, lkml

On Tue, Jun 22, 2021 at 01:15:17PM +0100, Matthew Wilcox (Oracle) wrote:
quoted hunk ↗ jump to hunk
 static struct mem_cgroup_per_node *
-mem_cgroup_page_nodeinfo(struct mem_cgroup *memcg, struct page *page)
+mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid)
 {
-	int nid = page_to_nid(page);
-
 	return memcg->nodeinfo[nid];
 }
I'd just kill this function entirely and open code it into the only
caller
-	mctz = soft_limit_tree_from_page(page);
+	mctz = soft_limit_tree_node(nid);
And while were at it, soft_limit_tree_node seems like a completely
pointless helper that does nothing but obsfucating the code.  While
you touch this area it might be worth to spin another patch to just
remove it as well.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help