On Wed, 17 Feb 2010, KAMEZAWA Hiroyuki wrote: > > This should panic in mem_cgroup_out_of_memory() and the documentation > > should be added to Documentation/sysctl/vm.txt. > > > > The memory controller also has some protection in the pagefault oom > > handler that seems like it could be made more general: instead of checking > > for mem_cgroup_oom_called(), I'd rather do a tasklist scan to check for > > already oom killed task (checking for the TIF_MEMDIE bit) and check all > > zones for ZONE_OOM_LOCKED. If no oom killed tasks are found and no zones > > are locked, we can check sysctl_panic_on_oom and invoke the system-wide > > oom. > > > plz remove memcg's hook after doing that. Current implemantation is desgined > not to affect too much to other cgroups by doing unnecessary jobs. > Ok, I'll eliminate pagefault_out_of_memory() and get it to use out_of_memory() by only checking for constrained_alloc() when gfp_mask != 0. > > > 2. Second, I'll add OOM-notifier and freeze_at_oom to memcg. > > > and don't call memcg_out_of_memory in oom_kill.c in this case. Because > > > we don't kill anything. Taking coredumps of all procs in memcg is not > > > very difficult. > > > > > > > The oom notifier would be at a higher level than the oom killer, the oom > > killer's job is simply to kill a task when it is called. > > So for these particular cases, you would never even call into out_of_memory() to panic > > the machine in the first place. > > That's my point. > Great, are you planning on implementing a cgroup that is based on roughly on the /dev/mem_notify patchset so userspace can poll() a file and be notified of oom events? It would help beyond just memcg, it has an application to cpusets (adding more mems on large systems) as well. It can also be used purely to preempt the kernel oom killer and move all the policy to userspace even though it would be sacrificing TIF_MEMDIE. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>