From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with SMTP id D0DC26B01EE for ; Thu, 1 Apr 2010 10:31:22 -0400 (EDT) Date: Thu, 1 Apr 2010 16:27:58 +0200 From: Oleg Nesterov Subject: Re: [patch -mm] oom: hold tasklist_lock when dumping tasks Message-ID: <20100401142758.GA14603@redhat.com> References: <20100328162821.GA16765@redhat.com> <20100329112111.GA16971@redhat.com> <20100330154659.GA12416@redhat.com> <20100331175836.GA11635@redhat.com> <20100331204718.GD11635@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: David Rientjes Cc: Andrew Morton , KOSAKI Motohiro , nishimura@mxp.nes.nec.co.jp, KAMEZAWA Hiroyuki , linux-mm@kvack.org List-ID: On 04/01, David Rientjes wrote: > > dump_header() always requires tasklist_lock to be held because it calls > dump_tasks() which iterates through the tasklist. There are a few places > where this isn't maintained, so make sure tasklist_lock is always held > whenever calling dump_header(). Looks correct, but I'd suggest you to update the changelog. Not only dump_tasks() needs tasklist, oom_kill_process() needs it too for list_for_each_entry(children). You fixed this: > @@ -724,8 +719,10 @@ void pagefault_out_of_memory(void) > > if (try_set_system_oom()) { > constrained_alloc(NULL, 0, NULL, &totalpages); > + read_lock(&tasklist_lock); > err = oom_kill_process(current, 0, 0, 0, totalpages, NULL, > "Out of memory (pagefault)"); > + read_unlock(&tasklist_lock); 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