Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932131AbWEVF6y (ORCPT ); Mon, 22 May 2006 01:58:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932132AbWEVF6y (ORCPT ); Mon, 22 May 2006 01:58:54 -0400 Received: from lmcgw.cs.sunysb.edu ([130.245.128.4]:52201 "EHLO smtp.lmc.cs.sunysb.edu") by vger.kernel.org with ESMTP id S932131AbWEVF6y (ORCPT ); Mon, 22 May 2006 01:58:54 -0400 Date: Mon, 22 May 2006 01:58:52 -0400 From: Giridhar Pemmasani To: Nick Piggin Cc: linux-kernel@vger.kernel.org Subject: Re: __vmalloc with GFP_ATOMIC causes 'sleeping from invalid context' In-Reply-To: <447119B3.7000506@yahoo.com.au> References: <20060522013648.6FCEAEE9EE@wolfe.lmc.cs.sunysb.edu> <447119B3.7000506@yahoo.com.au> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 MULE XEmacs/21.4 (patch 19) (Constant Variable) (i386-debian-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20060522055852.63940EE9EE@wolfe.lmc.cs.sunysb.edu> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 42 On Mon, 22 May 2006 11:53:55 +1000, Nick Piggin said: > Giridhar Pemmasani wrote: >> If __vmalloc is called in atomic context with GFP_ATOMIC flags, >> __get_vm_area_node is called, which calls kmalloc_node with >> GFP_KERNEL flags. This causes 'sleeping function called from >> invalid context at mm/slab.c:2729' with 2.6.16-rc4 kernel. A >> simple solution is to use > I can't see what would cause this in either 2.6.16-rc4 or > 2.6.17-rc4. What is the line? If someone calls __vmalloc in atomic context (with GFP_ATOMIC flags): with 2.6.17-rc4, in file mm/vmalloc.c, __vmalloc calls __vmalloc_node on line 484, __vmalloc_node calls get_vm_area_node on line 474, get_vm_area_node calls __get_vm_area_node on line 256, __get_vm_area_node calls kmalloc_node with GFP_KERNEL on line 180 and in include/linux/slab.h, kmalloc_node calls kmalloc with GFP_KERNEL on line 164, kmalloc calls kmem_cache_alloc on line 106, and in mm/slab.c, kmem_cache_alloc calls __cache_alloc on line 3136, __cache_alloc calls cache_alloc_debugcheck_before on line 2880, cache_alloc_debugcheck_before calls might_sleep_if(GFP_KERNEL & GFP_WAIT) on line 2783 which causes the warning. -- Giri - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/