lkml.org 
[lkml]   [2008]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@jp.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 -


\
 
 \ /
  Last update: 2008-11-30 13:33    [W:0.191 / U:1.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site