Messages in this thread Patch in this message | | | Date | Fri, 27 Mar 2009 14:13:22 +0900 | From | KAMEZAWA Hiroyuki <> | Subject | [RFC][PATCH 8/8] extends soft limit event filter |
| |
Reduce softlimit update ratio depends on its priority(usage).
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> --- mm/memcontrol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
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 @@ -945,11 +945,15 @@ static bool mem_cgroup_soft_limit_check( bool ret = false; int cpu = get_cpu(); s64 val; + int thresh; struct mem_cgroup_stat_cpu *cpustat; cpustat = &mem->stat.cpustat[cpu]; val = __mem_cgroup_stat_read_local(cpustat, MEM_CGROUP_STAT_EVENTS); - if (unlikely(val > SOFTLIMIT_EVENTS_THRESH)) { + /* If usage is big, this check can be rough */ + thresh = SOFTLIMIT_EVENTS_THRESH; + thresh <<= (mem->soft_limit_priority >> 1); + if (unlikely(val > thresh)) { __mem_cgroup_stat_reset_safe(cpustat, MEM_CGROUP_STAT_EVENTS); ret = true; }
| |