From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934108AbYD1TjH (ORCPT ); Mon, 28 Apr 2008 15:39:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764983AbYD1Tiy (ORCPT ); Mon, 28 Apr 2008 15:38:54 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36341 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763088AbYD1Tix (ORCPT ); Mon, 28 Apr 2008 15:38:53 -0400 Date: Mon, 28 Apr 2008 12:37:59 -0700 (PDT) From: Linus Torvalds To: Thomas Gleixner cc: Harvey Harrison , Ingo Molnar , Andrew Morton , LKML , David Miller Subject: Re: [PATCH] bitops: simplify generic bit finding functions In-Reply-To: Message-ID: References: <1209327591.14173.74.camel@brick> User-Agent: Alpine 1.10 (LFD 962 2008-03-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 On Mon, 28 Apr 2008, Thomas Gleixner wrote: > > I doubt that that is worth the trouble and we should just remove those > inlines alltogether. This was discussed before, but Andi objected to > remove those micro optimizations and nobody had time to actually > verify the real benefits. Thanks for checking. In general, I think we should act the other way: we should *assume* that inlines and complex macros in header files are not worth it and we'd be better off with just plain function calls, unless it's really obvious that the inline function is always worth it. We have tons of good examples of inline functions in headers that really *really* want to be that way: is generally a collection of things that clearly expand to somthing that is (a) easily critical and (b) inlining things generally really causes a smaller code footprint than having a "call" instruction and all the argument setup - regardless of how many times it is done. So we do have cases where the inlines are obviously worth it. But in general, I think we should try to move things from the header files into *.c files unless there is a really clear reason for keeping it that way. (Some inline functions do depend on things like constant arguments goign away, with kmalloc() being a good example of some really nasty header file tricks that are likely worth it despite their extreme ugliness) Linus