lkml.org 
[lkml]   [2009]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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;
}


\
 
 \ /
  Last update: 2009-03-27 06:17    [W:0.286 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site