[PATCH 0/2] memcg: fix oom handling

From: KAMEZAWA Hiroyuki
Date: Fri Nov 21 2008 - 04:59:27 EST



Li Zefan reported

(a) This goes dead lock:
==
#echo 0 > (...)/01/memory.limit_in_bytes #set memcg's limit to 0,
#echo $$ > (...)/01/memory.tasks #move task
# do something...
==

(b) seems to be dead lock
==
#echo 40k > (...)/01/memory.limit_in_bytes #set memcg's limit to 0,
#echo $$ > (...)/01/memory.tasks #move task
# do something...
==


I think (a) is BUG. (b) is just slow down.
(you can see pgpgin/pgpgout count is increasing in (B).)

This patch set is for handling (a). Li-san, could you check ?
This works well in my environment.(means OOM-Killer is called in proper way.)

[1/2].... current mmotm has pagefault_out_of_memory() but this doesn't consider
memcg. When memcg hit limits in page_fault and panic_on_oom is set,
the kernel panics.
This tries to fix that.
(See patches/mm-invoke-oom-killer-from-page-fault.patch)

[2/2].... fixes wrong logic of check_under_limit.

Anyway, it seems hierarchy support is *not* enough in OOM handler.
Balbir, could you check it ?
I think "a bad process in hierarchy rather than memcg" should be killed.

Thanks,
-Kame

--
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/