Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932544AbWEVHIV (ORCPT ); Mon, 22 May 2006 03:08:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932539AbWEVHIV (ORCPT ); Mon, 22 May 2006 03:08:21 -0400 Received: from lmcgw.cs.sunysb.edu ([130.245.128.4]:18353 "EHLO smtp.lmc.cs.sunysb.edu") by vger.kernel.org with ESMTP id S932544AbWEVHIU (ORCPT ); Mon, 22 May 2006 03:08:20 -0400 Date: Mon, 22 May 2006 03:08:19 -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: <447156AB.30909@yahoo.com.au> References: <20060522013648.6FCEAEE9EE@wolfe.lmc.cs.sunysb.edu> <447119B3.7000506@yahoo.com.au> <20060522055852.63940EE9EE@wolfe.lmc.cs.sunysb.edu> <4471551B.1070701@yahoo.com.au> <447155E5.8060406@yahoo.com.au> <447156AB.30909@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: <20060522070819.23CC5EE9EE@wolfe.lmc.cs.sunysb.edu> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 27 On Mon, 22 May 2006 16:14:03 +1000, Nick Piggin said: > Nick Piggin wrote: >> OTOH, it doesn't seem to be particularly wrong to allow __vmalloc >> GFP_ATOMIC allocations. The correct fix is to pass the gfp_mask >> to kmalloc: if you're worried about breaking the API, introduce a >> new __get_vm_area_node_mask() and implement __get_vm_area_node() >> as a simple wrapper that passes in GFP_KERNEL. > Oh, and __get_vm_area_node{_mask} should BUG_ON(in_interrupt()); With the patch I sent earlier, this may not be required: Since __get_vm_area_node calls kmalloc, it should be taken care of in kmalloc and friends. Currently cache_alloc_debugcheck_before doesn't check for in_interrupt(); perhaps that is the right place to add if (flags & GFP_WAIT) BUG_ON(in_interrupt()); Thanks, 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/