Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758373AbZDBOAN (ORCPT ); Thu, 2 Apr 2009 10:00:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757613AbZDBN76 (ORCPT ); Thu, 2 Apr 2009 09:59:58 -0400 Received: from smtp.ultrahosting.com ([74.213.174.254]:59282 "EHLO smtp.ultrahosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757500AbZDBN75 (ORCPT ); Thu, 2 Apr 2009 09:59:57 -0400 Date: Thu, 2 Apr 2009 09:53:31 -0400 (EDT) From: Christoph Lameter X-X-Sender: cl@qirst.com To: Ingo Molnar cc: Linus Torvalds , Tejun Heo , Martin Schwidefsky , rusty@rustcorp.com.au, tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, Paul Mundt , rmk@arm.linux.org.uk, starvik@axis.com, ralf@linux-mips.org, davem@davemloft.net, cooloney@kernel.org, kyle@mcmartin.ca, matthew@wil.cx, grundler@parisc-linux.org, takata@linux-m32r.org, benh@kernel.crashing.org, rth@twiddle.net, ink@jurassic.park.msu.ru, heiko.carstens@de.ibm.com, Nick Piggin , Peter Zijlstra Subject: Re: [PATCH UPDATED] percpu: use dynamic percpu allocator as the default percpu allocator In-Reply-To: <20090402034223.GA25791@elte.hu> Message-ID: References: <49D2B209.9060000@kernel.org> <20090401154913.GA31435@elte.hu> <20090401190113.GA734@elte.hu> <20090401223241.GA28168@elte.hu> <20090402034223.GA25791@elte.hu> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) 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 Content-Length: 1319 Lines: 35 On Thu, 2 Apr 2009, Ingo Molnar wrote: > to quote an earlier part of my mail: > > > > We encourage kfree(NULL) and it triggers commonly in the kernel > > > today [on distro kernels we checked it can trigger once per > > > syscall!] - so i think we should consider free_percpu(NULL) a > > > possibly common pattern too. (even though today it's likely > > > _not_ common at all.) > > I specifically mentioned that it is not at all common now. What is this? Nonsense day? Consider it a common pattern although its likely not common at all? April fools day? > But there's no reason why an object shutdown fastpath with an > optional percpu buffer (say for debug statistics, not enabled by > default) couldnt look like this: > > percpu_free(NULL); > > We actually have such patterns of kfree(ptr) use, where the _common_ > case in a fastpath is kfree(NULL). Speculation. A shutdown fastpath? The percpu allocation and free operations are expensive and deal with teardown and setup of virtual mappings. Those paths are *not* optimized for fastpath use. kfree is different. -- 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/