lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090331171840.83fb7dab.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Tue, 31 Mar 2009 17:18:40 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"balbir@...ux.vnet.ibm.com" <balbir@...ux.vnet.ibm.com>,
	"kosaki.motohiro@...fujitsu.com" <kosaki.motohiro@...fujitsu.com>,
	"nishimura@....nes.nec.co.jp" <nishimura@....nes.nec.co.jp>
Subject: Re: [RFC][PATCH 5/8] memcg soft limit (yet another new design) v1

On Fri, 27 Mar 2009 14:09:23 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> wrote:

> memcg's reclaim routine is designed to ignore locality andplacements and
> then, inactive_anon_is_low() function doesn't take "zone" as its argument.
> 
> In later soft limit patch, we use "zone" as an arguments.
> 
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> ---
> Index: mmotm-2.6.29-Mar23/mm/memcontrol.c
> ===================================================================
> --- mmotm-2.6.29-Mar23.orig/mm/memcontrol.c
> +++ mmotm-2.6.29-Mar23/mm/memcontrol.c
> @@ -561,15 +561,28 @@ void mem_cgroup_record_reclaim_priority(
>  	spin_unlock(&mem->reclaim_param_lock);
>  }
>  
> -static int calc_inactive_ratio(struct mem_cgroup *memcg, unsigned long *present_pages)
> +static int calc_inactive_ratio(struct mem_cgroup *memcg,
> +			       unsigned long *present_pages,
> +			       struct zone *z)
>  {
>  	unsigned long active;
>  	unsigned long inactive;
>  	unsigned long gb;
>  	unsigned long inactive_ratio;
>  
> -	inactive = mem_cgroup_get_local_zonestat(memcg, LRU_INACTIVE_ANON);
> -	active = mem_cgroup_get_local_zonestat(memcg, LRU_ACTIVE_ANON);
> +	if (!z) {
> +		inactive = mem_cgroup_get_local_zonestat(memcg,
> +							 LRU_INACTIVE_ANON);
> +		active = mem_cgroup_get_local_zonestat(memcg, LRU_ACTIVE_ANON);
> +	} else {
> +		int nid = z->zone_pgdat->node_id;
> +		int zid = zone_idx(z);
> +		struct mem_cgroup_per_zone *mz;
> +
> +		mz = mem_cgroup_zoneinfo(memcg, nid, zid);
> +		inactive = MEM_CGROUP_ZSTAT(mz, LRU_INACTIVE_ANON);
> +		active = MEM_CGROUP_ZSTAT(mz, LRU_ACTIVE_ANON);
> +	}
>  
>  	gb = (inactive + active) >> (30 - PAGE_SHIFT);
>  	if (gb)
> @@ -585,14 +598,14 @@ static int calc_inactive_ratio(struct me
>  	return inactive_ratio;
>  }
>  
> -int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
> +int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *z)
>  {
>  	unsigned long active;
>  	unsigned long inactive;
>  	unsigned long present_pages[2];
>  	unsigned long inactive_ratio;
>  
> -	inactive_ratio = calc_inactive_ratio(memcg, present_pages);
> +	inactive_ratio = calc_inactive_ratio(memcg, present_pages, NULL);

The last arguments should be "z" not NULL...

seems posted version is a bit old...OMG, sorry.

I'm now adding bugfix etc..

-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ