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]
Date:	Sun, 30 Nov 2008 15:25:54 +0300
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 02/09] memcg: make inactive_anon_is_low()

[KOSAKI Motohiro - Sun, Nov 30, 2008 at 07:56:37PM +0900]
| make inactive_anon_is_low for memcgroup.
| it improve active_anon vs inactive_anon ratio balancing.
| 
| 
| Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
| ---
...
| +static void mem_cgroup_set_inactive_ratio(struct mem_cgroup *memcg)
| +{
| +	unsigned int gb, ratio;
| +
| +	gb = res_counter_read_u64(&memcg->res, RES_LIMIT) >> 30;
| +	ratio = int_sqrt(10 * gb);
| +	if (!ratio)
| +		ratio = 1;

Hi Kosaki,

maybe better would be

	gb = ...;
	if (gb) {
		ratio = int_sqrt(10 * gb);
	} else
		ratio = 1;

| +
| +	memcg->inactive_ratio = ratio;
| +
| +}
| +
...

		- Cyrill -
--
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