From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbZBIIoS (ORCPT ); Mon, 9 Feb 2009 03:44:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751377AbZBIIoG (ORCPT ); Mon, 9 Feb 2009 03:44:06 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:34336 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbZBIIoF (ORCPT ); Mon, 9 Feb 2009 03:44:05 -0500 Date: Mon, 9 Feb 2009 00:43:19 -0800 From: Andrew Morton To: Ingo Molnar Cc: Yinghai Lu , tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] irq: optimize init_kstat_irqs/init_copy_kstat_irqs Message-Id: <20090209004319.cc8c5d8b.akpm@linux-foundation.org> In-Reply-To: <20090209083739.GB15517@elte.hu> References: <498CB0B7.8030009@kernel.org> <20090206140005.44b4bb50.akpm@linux-foundation.org> <498CB4DC.2010108@kernel.org> <498D3D15.5090005@kernel.org> <20090207002610.73ff7e6d.akpm@linux-foundation.org> <86802c440902070101l5b0ef862ja92e3f31705d9608@mail.gmail.com> <20090207010619.daededa3.akpm@linux-foundation.org> <20090209081124.GB24420@elte.hu> <20090209001903.89548108.akpm@linux-foundation.org> <20090209083739.GB15517@elte.hu> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Feb 2009 09:37:39 +0100 Ingo Molnar wrote: > > * Andrew Morton wrote: > > > On Mon, 9 Feb 2009 09:11:24 +0100 Ingo Molnar wrote: > > > > > > > > * Andrew Morton wrote: > > > > > > > On Sat, 7 Feb 2009 01:01:03 -0800 Yinghai Lu wrote: > > > > > > > > > > > > > > add kzalloc_node_safe()? > > > > > > > > I cannot find that function. > > > > > > His suggestion is to provide that allocator variant. > > > > > > > Oh. > > > > It isn't possible to write a kzalloc_node_safe(GFP_ATOMIC). Or at > > least, we've never worked out a way. > > > > Maybe I'm confused again. > > Indeed - duh - more morning tea needed. > > Yinghai, why are those allocations GFP_ATOMIC to begin with? These: > > earth4:~/tip> grep GFP_ATOMIC kernel/irq/*.c > kernel/irq/handle.c: ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs), GFP_ATOMIC, node); > kernel/irq/handle.c: desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node); > kernel/irq/manage.c: action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC); > > Should all be GFP_KERNEL. Wherever they are within a spinlocked section the code > should be restructured. All descriptor data structures should be preallocated at > __setup_irq() time. If we ever need to allocate dynamically later on, in the middle > of some difficult codepath that's a structure bug in the code. yup, something along those lines. > and this one: > > kernel/irq/numa_migrate.c: desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node); > > should fail the migration silently if GFP_ATOMIC returns NULL. Silent failure sounds bad? The allocation attempt will spew a page-allocation-failure backtrace anyway, so people will still get alarmed. You might instead choose to suppress that warning with __GFP_NOWARN and instead add a more meaningful warning at the calling codesite.