Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758300AbZFIQp2 (ORCPT ); Tue, 9 Jun 2009 12:45:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755700AbZFIQpT (ORCPT ); Tue, 9 Jun 2009 12:45:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50122 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755174AbZFIQpS (ORCPT ); Tue, 9 Jun 2009 12:45:18 -0400 Date: Tue, 9 Jun 2009 18:45:19 +0200 From: Nick Piggin To: Linus Torvalds Cc: Rusty Russell , Ingo Molnar , Jeremy Fitzhardinge , "H. Peter Anvin" , Thomas Gleixner , Linux Kernel Mailing List , Andrew Morton , Peter Zijlstra , Avi Kivity , Arjan van de Ven Subject: Re: [benchmark] 1% performance overhead of paravirt_ops on native kernels Message-ID: <20090609164519.GE9211@wotan.suse.de> References: <200906032208.28061.rusty@rustcorp.com.au> <200906041554.37102.rusty@rustcorp.com.au> <20090609093918.GC16940@wotan.suse.de> <20090609153847.GB9211@wotan.suse.de> <20090609162125.GC9211@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1414 Lines: 33 On Tue, Jun 09, 2009 at 09:26:47AM -0700, Linus Torvalds wrote: > > > On Tue, 9 Jun 2009, Nick Piggin wrote: > > > > The idea seems nice but isn't the problem that kmap gives back a > > basically 1st class kernel virtual memory? (ie. it can then be used > > by any other CPU at any point without it having to use kmap?). > > No, everybody has to use kmap()/kunmap(). So it is strictly a bug to expose a pointer returned by kmap to another CPU? That would make it easier, although it would need to remove the global bit I think so when one task migrates CPUs then the entry will be flushed and reloaded properly. > The "problem" is that you could in theory run out of kmap frames, since if > everybody does a kmap() in an interruptible context and you have lots and > lots of threads doing different pages, you'd run out. But that has nothing > to do with kmap_atomic(), which is basically limited to just the number of > CPU's and a (very small) level of nesting. This could be avoided with an anti-deadlock pool. If a task attempts a nested kmap and already holds a kmap, then give it exclusive access to this pool until it releases its last nested kmap. -- 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/