Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754163Ab2FIP5u (ORCPT ); Sat, 9 Jun 2012 11:57:50 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:61284 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753649Ab2FIP5s (ORCPT ); Sat, 9 Jun 2012 11:57:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <1339176197-13270-1-git-send-email-js1304@gmail.com> Date: Sun, 10 Jun 2012 00:57:48 +0900 Message-ID: Subject: Re: [PATCH 1/4] slub: change declare of get_slab() to inline at all times From: JoonSoo Kim To: Christoph Lameter Cc: Pekka Enberg , linux-kernel@vger.kernel.org, linux-mm@kvack.org 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: 992 Lines: 21 2012/6/9 Christoph Lameter : > On Sat, 9 Jun 2012, Joonsoo Kim wrote: > >> -static struct kmem_cache *get_slab(size_t size, gfp_t flags) >> +static __always_inline struct kmem_cache *get_slab(size_t size, gfp_t flags) > > I thought that the compiler felt totally free to inline static functions > at will? This may be a matter of compiler optimization settings. I can > understand the use of always_inline in a header file but why in a .c file? Yes, but the compiler with -O2 doesn't inline get_slab() which declared just 'static'. I think that inlining get_slab() have a performance benefit, so add '__always_inline' to declare of get_slab(). Other functions like slab_alloc, slab_free also use 'always_inline' in .c file (slub.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/