[Devel] Re: [RFC][ for -mm] memory cgroup enhancements take3 [9/9] per zone stat
YAMAMOTO Takashi
yamamoto at valinux.co.jp
Tue Oct 30 05:32:59 PDT 2007
> +
> +/*
> + * Per-zone statistics.
> + * Please be carefull. The array can be very big on envrionments whic has
> + * very big MAX_NUMNODES . Adding new stat member to this will eat much memory.
> + * Only Active/Inactive may be sutiable.
s/whic/&h/
s/sutiable/suitable/
> +static inline void __mem_cgroup_zonesta_dec(struct mem_cgroup_zonestat *zstat,
s/zonesta/&t/
> @@ -293,6 +369,23 @@ clear_page_cgroup(struct page *page, str
>
> static void __mem_cgroup_move_lists(struct page_cgroup *pc, bool active)
> {
> + int direction = 0;
> +
> + if (active && !(pc->flags & PAGE_CGROUP_FLAG_ACTIVE))
> + direction = 1; /*from inactive to acvive */
> + if (!active && (pc->flags & PAGE_CGROUP_FLAG_ACTIVE))
> + direction = -1;
> +
> + if (direction) {
> + struct mem_cgroup_zonestat *zstat = &pc->mem_cgroup->zonestat;
> + int index = page_cgroup_to_zonestat_index(pc);
> + preempt_disable();
> + __mem_cgroup_zonestat_add(zstat, MEM_CGROUP_ZONESTAT_ACTIVE,
> + direction, index);
> + __mem_cgroup_zonestat_add(zstat, MEM_CGROUP_ZONESTAT_INACTIVE,
> + direction, index);
dec?
YAMAMOTO Takashi
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list