From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx135.postini.com [74.125.245.135]) by kanga.kvack.org (Postfix) with SMTP id E45676B005A for ; Wed, 17 Oct 2012 01:43:30 -0400 (EDT) Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 747F03EE0C8 for ; Wed, 17 Oct 2012 14:43:28 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id EBFBA45DE50 for ; Wed, 17 Oct 2012 14:43:27 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id EBC3645DE5F for ; Wed, 17 Oct 2012 14:43:25 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 70BE41DB8040 for ; Wed, 17 Oct 2012 14:43:25 +0900 (JST) Received: from m1001.s.css.fujitsu.com (m1001.s.css.fujitsu.com [10.240.81.139]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id E0C4D1DB803E for ; Wed, 17 Oct 2012 14:43:24 +0900 (JST) Message-ID: <507E4531.1070700@jp.fujitsu.com> Date: Wed, 17 Oct 2012 14:42:09 +0900 From: Kamezawa Hiroyuki MIME-Version: 1.0 Subject: Re: [patch for-3.7] mm, mempolicy: fix printing stack contents in numa_maps References: <20121008150949.GA15130@redhat.com> <20121017040515.GA13505@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Dave Jones , Andrew Morton , Linus Torvalds , KOSAKI Motohiro , bhutchings@solarflare.com, Konstantin Khlebnikov , Naoya Horiguchi , Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org (2012/10/17 14:24), David Rientjes wrote: > On Wed, 17 Oct 2012, Dave Jones wrote: > >> BUG: sleeping function called from invalid context at kernel/mutex.c:269 >> in_atomic(): 1, irqs_disabled(): 0, pid: 8558, name: trinity-child2 >> 3 locks on stack by trinity-child2/8558: >> #0: held: (&p->lock){+.+.+.}, instance: ffff88010c9a00b0, at: [] seq_lseek+0x3f/0x120 >> #1: held: (&mm->mmap_sem){++++++}, instance: ffff88013956f7c8, at: [] m_start+0xa7/0x190 >> #2: held: (&(&p->alloc_lock)->rlock){+.+...}, instance: ffff88011fc64f30, at: [] show_numa_map+0x14f/0x610 >> Pid: 8558, comm: trinity-child2 Not tainted 3.7.0-rc1+ #32 >> Call Trace: >> [] __might_sleep+0x14c/0x200 >> [] mutex_lock_nested+0x2e/0x50 >> [] mpol_shared_policy_lookup+0x33/0x90 >> [] shmem_get_policy+0x33/0x40 >> [] get_vma_policy+0x3a/0x90 >> [] show_numa_map+0x163/0x610 >> [] ? pid_maps_open+0x20/0x20 >> [] ? pagemap_hugetlb_range+0xf0/0xf0 >> [] show_pid_numa_map+0x13/0x20 >> [] traverse+0xf2/0x230 >> [] seq_lseek+0xab/0x120 >> [] sys_lseek+0x7b/0xb0 >> [] tracesys+0xe1/0xe6 >> > > Hmm, looks like we need to change the refcount semantics entirely. We'll > need to make get_vma_policy() always take a reference and then drop it > accordingly. This work sif get_vma_policy() can grab a reference while > holding task_lock() for the task policy fallback case. > > Comments on this approach? I think this refcounting is better than using task_lock(). Thanks, -Kame -- 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