Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971258AbXFHWay (ORCPT ); Fri, 8 Jun 2007 18:30:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1032326AbXFHWaO (ORCPT ); Fri, 8 Jun 2007 18:30:14 -0400 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:57585 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032319AbXFHWaM (ORCPT ); Fri, 8 Jun 2007 18:30:12 -0400 Date: Fri, 8 Jun 2007 15:30:09 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Andrew Morton cc: anil.s.keshavamurthy@intel.com, linux-kernel@vger.kernel.org, ak@suse.de, gregkh@suse.de, muli@il.ibm.com, asit.k.mallick@intel.com, suresh.b.siddha@intel.com, arjan@linux.intel.com, ashok.raj@intel.com, shaohua.li@intel.com, davem@davemloft.net Subject: Re: [Intel-IOMMU 06/10] Intel IOMMU driver In-Reply-To: <20070607165739.dc437e96.akpm@linux-foundation.org> Message-ID: References: <20070606185658.138237000@askeshav-devel.jf.intel.com> <20070606190042.823168000@askeshav-devel.jf.intel.com> <20070607165739.dc437e96.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 889 Lines: 26 On Thu, 7 Jun 2007, Andrew Morton wrote: > > +void *iommu_rpool_alloc(unsigned int size, gfp_t flag) > > +{ > > + if (size == PAGE_SIZE_4K) > > + return(void *)get_zeroed_page(flag); > > + else > > + return kzalloc(size, flag); > > +} > > kmalloc(4k) is pretty efficient and (I think) is guaranteed to return a > page-aligned address. Page allocations should be done through the page allocator. 4k allocations benefit from the per cpu caches of the page allocator which makes the use of the page allocator fastest and best for 4k allocs. kmalloc allocations are not guaranteed to be aligned to 4k boundaries. They usually are but ... - 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/