From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761323AbYCERWo (ORCPT ); Wed, 5 Mar 2008 12:22:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757695AbYCERWV (ORCPT ); Wed, 5 Mar 2008 12:22:21 -0500 Received: from www.tglx.de ([62.245.132.106]:55812 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757386AbYCERWU (ORCPT ); Wed, 5 Mar 2008 12:22:20 -0500 Date: Wed, 5 Mar 2008 18:20:49 +0100 (CET) From: Thomas Gleixner To: Nick Piggin cc: LKML , Andrew Morton , Greg KH , Peter Zijlstra , Ingo Molnar Subject: Re: [patch 1/5] vmalloc: do not check for freed locks on user maps In-Reply-To: <200803060328.20349.nickpiggin@yahoo.com.au> Message-ID: References: <20080305154829.185609547@linutronix.de> <20080305155117.447021903@linutronix.de> <200803060328.20349.nickpiggin@yahoo.com.au> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Mar 2008, Nick Piggin wrote: > On Thursday 06 March 2008 03:03, Thomas Gleixner wrote: > > User maps do not contain kernel internal objects. No need to check > > them. > > Why not? Depends on your definition of kernel internal... and > objects ;) > > Drivers could create and manage some objects in this vmalloc > area. They are no longer internal if you map them to userspace, > but I still don't think you want to vunmap it until those > object lifetimes are finished. Well, in case of the locks I have a hard time to figure out how you use a spinlock/mutex with a user space address. The same applies for timers or other objects used by kernel subsystems. So when the driver writer creates an kernel related object in the vmalloc space, he has to use the kernel mapping which is unmapped separate, right ? I can see your concern about the infinite stu^H^H^Hcreativity of driver writers, but I prefer not to go down that road and provide debug infrastructure for absurdities. Thanks, tglx > > Signed-off-by: Thomas Gleixner > > Acked-by: Ingo Molnar > > --- > > mm/vmalloc.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > Index: linux-2.6/mm/vmalloc.c > > =================================================================== > > --- linux-2.6.orig/mm/vmalloc.c > > +++ linux-2.6/mm/vmalloc.c > > @@ -382,7 +382,8 @@ static void __vunmap(const void *addr, i > > return; > > } > > > > - debug_check_no_locks_freed(addr, area->size); > > + if (!(area->flags & VM_USERMAP)) > > + debug_check_no_locks_freed(addr, area->size); > > > > if (deallocate_pages) { > > int i; >