From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id 5729F6B01AC for ; Wed, 2 Jun 2010 16:39:47 -0400 (EDT) Date: Wed, 2 Jun 2010 22:38:27 +0200 From: Oleg Nesterov Subject: Re: [PATCH] oom: Make coredump interruptible Message-ID: <20100602203827.GA29244@redhat.com> References: <20100601093951.2430.A69D9226@jp.fujitsu.com> <20100601201843.GA20732@redhat.com> <20100602221805.F524.A69D9226@jp.fujitsu.com> <20100602154210.GA9622@redhat.com> <20100602172956.5A3E34A491@magilla.sf.frob.com> <20100602175325.GA16474@redhat.com> <20100602185812.4B5894A549@magilla.sf.frob.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100602185812.4B5894A549@magilla.sf.frob.com> Sender: owner-linux-mm@kvack.org To: Roland McGrath Cc: KOSAKI Motohiro , LKML , linux-mm , David Rientjes , Andrew Morton , KAMEZAWA Hiroyuki , Nick Piggin List-ID: On 06/02, Roland McGrath wrote: > > > when select_bad_process() finds the task P to kill it can participate > > in the core dump (sleep in exit_mm), but we should somehow inform the > > thread which actually dumps the core: P->mm->core_state->dumper. > > Perhaps it should simply do that: if you would choose P to oom-kill, and > P->mm->core_state!=NULL, then choose P->mm->core_state->dumper instead. ... to set TIF_MEMDIE which should be checked in elf_core_dump(). Probably yes. > > Well, we can use TIF_MEMDIE if we chose the right thread, I think. > > But perhaps mm->flags |= MMF_OOM is better, it can have other user. > > I dunno. > > This is all the quick hack before get around to just making core dumping > fully-interruptible, no? So we should go with whatever is the simplest > change now. Yes. > Perhaps this belongs in another thread as you suggested. But I wonder what > we might get just from s/TASK_UNINTERRUPTIBLE/TASK_KILLABLE/ in exit_mm. Oh. This needs more thinking. Definitely the task sleeping in exit_mm() must not exit until core_state->dumper->thread returns from do_coredump(). If nothing else, the dumper can use its task_struct and it relies on the stable core_thread->next list. And right now TASK_KILLABLE can't work anyway, it is possible that fatal_signal_pending() is true. But perhaps we can do something later. Assuming that do_coredump() is interruptible, TASK_KILLABLE can make the difference only if the dumper belongs to another thread-group. Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org