Re: [PATCH][Cleanup] memcg: consolidates memory cgroup lru stat functions

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

 



On Thu, Jul 7, 2011 at 12:22 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> In mm/memcontrol.c, there are many lru stat functions as..
>
> mem_cgroup_zone_nr_lru_pages
> mem_cgroup_node_nr_file_lru_pages
> mem_cgroup_nr_file_lru_pages
> mem_cgroup_node_nr_anon_lru_pages
> mem_cgroup_nr_anon_lru_pages
> mem_cgroup_node_nr_unevictable_lru_pages
> mem_cgroup_nr_unevictable_lru_pages
> mem_cgroup_node_nr_lru_pages
> mem_cgroup_nr_lru_pages
> mem_cgroup_get_local_zonestat
>
> Some of them are under #ifdef MAX_NUMNODES >1 and others are not.
> This seems bad. This patch consolidates all functions into
>
> mem_cgroup_zone_nr_lru_pages()
> mem_cgroup_node_nr_lru_pages()
> mem_cgroup_nr_lru_pages()
>
> For these functions, "which LRU?" information is passed by a mask.
>
> example)
> mem_cgroup_nr_lru_pages(mem, BIT(LRU_ACTIVE_ANON))
>
> And I added some macro as ALL_LRU, ALL_LRU_FILE, ALL_LRU_ANON.
> example)
> mem_cgroup_nr_lru_pages(mem, ALL_LRU)
>
> BTW, considering layout of NUMA memory placement of counters, this patch seems
> to be better.
>
> Now, when we gather all LRU information, we scan in following orer
>    for_each_lru -> for_each_node -> for_each_zone.
>
> This means we'll touch cache lines in different node in turn.
>
> After patch, we'll scan
>    for_each_node -> for_each_zone -> for_each_lru(mask)
>
> Then, we'll gather information in the same cacheline at once.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

Looks like a good cleanup, but unfortunately I won't be able to test
any patches till the end of next week or so

Balbir Singh

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href


[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]