Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934505Ab2JXI43 (ORCPT ); Wed, 24 Oct 2012 04:56:29 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:39309 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934183Ab2JXI41 (ORCPT ); Wed, 24 Oct 2012 04:56:27 -0400 MIME-Version: 1.0 In-Reply-To: <1350914737-4097-3-git-send-email-glommer@parallels.com> References: <1350914737-4097-1-git-send-email-glommer@parallels.com> <1350914737-4097-3-git-send-email-glommer@parallels.com> Date: Wed, 24 Oct 2012 11:56:25 +0300 X-Google-Sender-Auth: x7xuTmEedpALhYZr9QTXDwwi9MA Message-ID: Subject: Re: [PATCH 2/2] slab: move kmem_cache_free to common code From: Pekka Enberg To: Glauber Costa Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 979 Lines: 26 On Mon, Oct 22, 2012 at 5:05 PM, Glauber Costa wrote: > +/** > + * kmem_cache_free - Deallocate an object > + * @cachep: The cache the allocation was from. > + * @objp: The previously allocated object. > + * > + * Free an object which was previously allocated from this > + * cache. > + */ > +void kmem_cache_free(struct kmem_cache *s, void *x) > +{ > + __kmem_cache_free(s, x); > + trace_kmem_cache_free(_RET_IP_, x); > +} > +EXPORT_SYMBOL(kmem_cache_free); As Christoph mentioned, this is going to hurt performance. The proper way to do this is to implement the *hook* in mm/slab_common.c and call that from all the allocator specific kmem_cache_free() functions. Pekka -- 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/