[RFC][PATCH 8/8] extends soft limit event filter

From: KAMEZAWA Hiroyuki
Date: Fri Mar 27 2009 - 01:15:10 EST


Reduce softlimit update ratio depends on its priority(usage).

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
---
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;
}

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