Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753842AbbBKUSP (ORCPT ); Wed, 11 Feb 2015 15:18:15 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:40769 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752282AbbBKUSO (ORCPT ); Wed, 11 Feb 2015 15:18:14 -0500 Date: Wed, 11 Feb 2015 12:18:07 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Lameter cc: akpm@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, iamjoonsoo@lge.com, Jesper Dangaard Brouer Subject: Re: [PATCH 1/3] Slab infrastructure for array operations In-Reply-To: Message-ID: References: <20150210194804.288708936@linux.com> <20150210194811.787556326@linux.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-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: 1858 Lines: 45 On Wed, 11 Feb 2015, Christoph Lameter wrote: > > This patch is referencing functions that don't exist and can do so since > > it's not compiled, but I think this belongs in the next patch. I also > > think that this particular implementation may be slub-specific so I would > > have expected just a call to an allocator-defined > > __kmem_cache_alloc_array() here with i = __kmem_cache_alloc_array(). > > The implementation is generic and can be used in the same way for SLAB. > SLOB does not have these types of object though. > Ok, I didn't know if the slab implementation would follow the same format with the same callbacks or whether this would need to be cleaned up later. > > return 0 instead of using _HAVE_SLAB_ALLOCATOR_ARRAY_OPERATIONS at all. > > Ok that is a good idea. I'll just drop that macro and have all allocators > provide dummy functions. > > > > +#ifndef _HAVE_SLAB_ALLOCATOR_ARRAY_OPERATIONS > > > +void kmem_cache_free_array(struct kmem_cache *s, size_t nr, void **p) > > > +{ > > > + __kmem_cache_free_array(s, nr, p); > > > +} > > > +EXPORT_SYMBOL(kmem_cache_free_array); > > > +#endif > > > + > > > > Hmm, not sure why the allocator would be required to do the > > EXPORT_SYMBOL() if it defines kmem_cache_free_array() itself. This > > Keeping the EXPORT with the definition is the custom as far as I could > tell. > If you do dummy functions for all the allocators, then this should be as simple as unconditionally defining kmem_cache_free_array() and doing EXPORT_SYMBOL() here and then using your current implementation of __kmem_cache_free_array() for mm/slab.c. -- 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/