This patch does make OOM killer wait much longer before killing, thus system
stays under mem pressure longer and cache shrinks fully:
bash-2.03# oom_trigger; free
Terminated
total used free shared buffers cached
Mem: 126208 69068 57140 <== 0 0 12876
-/+ buffers/cache: 56192 70016
Swap: 0 0 0
bash-2.03# oom_trigger; free
Terminated
total used free shared buffers cached
Mem: 126208 65568 60640 <== 0 0 9412
-/+ buffers/cache: 56156 70052
Swap: 0 0 0
Note that second free isn't less than first one. With stock kernel you'll get
'free' falling after each oom kill.
> I realize this patch is just chasing a symptom, but it is self tuning so
> seems to be a good change regardless. Yes, it still kills ;)
Yes indeed :-)
> --------------------------------------------------------------------
> out_of_memory: cache size 41 Mb, since = 0.06
> out_of_memory: cache size 41 Mb, since = 0.11
> out_of_memory: cache size 41 Mb, since = 0.74
> out_of_memory: cache size 41 Mb, since = 0.83
> out_of_memory: cache size 40 Mb, since = 1.29
> out_of_memory: cache size 40 Mb, since = 1.48
> out_of_memory: cache size 40 Mb, since = 1.57
> out_of_memory: cache size 40 Mb, since = 2.37
<<< snip >>>
> out_of_memory: cache size 40 Mb, since = 29.46
> out_of_memory: cache size 40 Mb, since = 29.52
> out_of_memory: cache size 40 Mb, since = 30.04
> out_of_memory: cache size 40 Mb, since = 30.41
> out_of_memory: cache size 40 Mb, since = 30.78 << ~29 SECONDS AND NO CACHE
> SHRINKAGE!!??!! ***
> out_of_memory: cache size 39 Mb, since = 31.11
> out_of_memory: cache size 39 Mb, since = 31.25
> out_of_memory: cache size 39 Mb, since = 31.34
> out_of_memory: cache size 39 Mb, since = 31.44
> out_of_memory: cache size 39 Mb, since = 31.63
Same here. I modified the printk (# of pages instead of Mb):
-printk(KERN_DEBUG "out_of_memory: cache size %d Mb, since =
%lu.%02lu\n",mega, since/HZ, since%HZ);
+printk(KERN_DEBUG "out_of_memory: page_cache_size=%d,
since=%lu.%02lu\n",page_cache_size.counter, since/HZ, since%HZ);
out_of_memory: page_cache_size=6236, since=23.33
out_of_memory: page_cache_size=6220, since=23.49
out_of_memory: page_cache_size=6220, since=23.50
out_of_memory: page_cache_size=6220, since=23.55
out_of_memory: page_cache_size=6178, since=23.80
out_of_memory: page_cache_size=6178, since=23.88
Out of Memory: Killed process 1987 (a.out).
-- vda - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/