mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Harvey Harrison <harvey.harrison@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH] bitops: simplify generic bit finding functions
Date: Mon, 28 Apr 2008 23:55:55 +0200	[thread overview]
Message-ID: <20080428215555.GB16153@elte.hu> (raw)
In-Reply-To: <alpine.LFD.1.10.0804281233090.3119@woody.linux-foundation.org>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 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.

there's another benefit, and in asm-x86 we prefer to move inlines to .c 
files even in borderline cases because it simplifies the type 
dependencies: not having to fully define all types at the function 
prototype site avoids include file dependency hell.

Putting things like a task struct dereference into a lowlevel inline 
file easily causes dependency problems that causes people to use macros 
instead - which have their own set of readability and side-effect 
problems.

a third argument is that inlines seldom get smaller. So if they are 
borderline and we move them into a .c, and later on the function gets 
larger, no harm is done. But if we keep the inline in a .h in the 
borderline case and we grow the inline later on, the whole kernel bloats 
in a multiplied way, without any apparent direct feedback to the 
developer that something wrong and harmful just happened.

	Ingo

  reply	other threads:[~2008-04-28 21:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 20:19 Harvey Harrison
2008-04-27 20:26 ` Linus Torvalds
2008-04-27 20:29   ` Harvey Harrison
2008-04-27 20:36     ` Al Viro
2008-04-27 20:38       ` Harvey Harrison
2008-04-27 20:38     ` Linus Torvalds
2008-04-27 21:02       ` Al Viro
2008-04-28 14:04   ` Thomas Gleixner
2008-04-28 15:10     ` Alexander van Heukelum
2008-04-28 15:58       ` Thomas Gleixner
2008-04-28 16:25     ` Linus Torvalds
2008-04-28 16:47       ` Thomas Gleixner
2008-04-28 16:54         ` Linus Torvalds
2008-04-28 19:26           ` Thomas Gleixner
2008-04-28 19:37             ` Linus Torvalds
2008-04-28 21:55               ` Ingo Molnar [this message]
2008-04-29 10:01               ` [PATCH] bitops: remove "optimizations" Thomas Gleixner
2008-04-29 10:03                 ` David Miller
2008-04-29 12:34                   ` David Miller
2008-04-29 14:20                     ` Ingo Molnar
2008-04-29 22:31                       ` David Miller
2008-04-29 16:51                     ` Thomas Gleixner
2008-04-29 22:58                       ` David Miller
2008-04-29 23:30                         ` David Miller
2008-04-28 19:57           ` [PATCH] bitops: simplify generic bit finding functions Andi Kleen
2008-04-28 14:58   ` Alexander van Heukelum
2008-04-28 14:32 ` Alexander van Heukelum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080428215555.GB16153@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®