Re: [PATCH 13/27] mm, memcg: Move memcg limit enforcement from zones to nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 16, 2016 at 05:06:46PM +0200, Vlastimil Babka wrote:
> >@@ -323,13 +319,10 @@ EXPORT_SYMBOL(memcg_kmem_enabled_key);
> >
> > #endif /* !CONFIG_SLOB */
> >
> >-static struct mem_cgroup_per_zone *
> >-mem_cgroup_zone_zoneinfo(struct mem_cgroup *memcg, struct zone *zone)
> >+static struct mem_cgroup_per_node *
> >+mem_cgroup_nodeinfo(struct mem_cgroup *memcg, pg_data_t *pgdat)
> > {
> >-	int nid = zone_to_nid(zone);
> >-	int zid = zone_idx(zone);
> >-
> >-	return &memcg->nodeinfo[nid]->zoneinfo[zid];
> >+	return memcg->nodeinfo[pgdat->node_id];
> 
> I've noticed most callers pass NODE_DATA(nid) as second parameter, which is
> quite wasteful to just obtain back the node_id (I doubt the compiler can
> know that they will be the same?). So it would be more efficient to use nid
> instead of pg_data_t pointer in the signature.
> 

No harm in making the conversion, done now.

> > }
> >
> > /**
> >@@ -383,37 +376,35 @@ ino_t page_cgroup_ino(struct page *page)
> > 	return ino;
> > }
> >
> >-static struct mem_cgroup_per_zone *
> >+static struct mem_cgroup_per_node *
> > mem_cgroup_page_zoneinfo(struct mem_cgroup *memcg, struct page *page)
> 
> This could be renamed to _nodeinfo()?
> 

Renamed.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]