Re: [RFC][ for -mm] memory cgroup enhancements take3 [9/9] per zone stat

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

 



> > > +	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?
> > 
> direction(add value) is 1 or -1 here. Hmm, this is maybe confusing.
> ok, I'll clean up this.

adding the same value to both of active and inactive seems wrong.
i think you want to subtract 'direction' from inactive here.

YAMAMOTO Takashi
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux