public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] x86: more header untangling
Date: Wed, 11 Feb 2009 20:47:19 +0100	[thread overview]
Message-ID: <20090211194719.GA25968@elte.hu> (raw)
In-Reply-To: <49931F04.80605@goop.org>


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Ingo Molnar wrote:
>> constants can be considered data types too.
>
> Huh, that's a pretty broad definition of "type", to the degree that's  
> its fairly counter-intuitive and misleading.  But I don't care that much.

Well, it's a stretch, but constants of a specific type are a lot closer to
the notion of 'type' than to the notion of 'function/method/code'.

The problem we are trying to solve here is dependency hell.

Dependencies get generated by methods, which are functions/operators defined
over multiple type-spaces. For example:

   static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p)

Is a (mathematical) function defined over the:

   (struct mm_struct x struct task_struct) 

two-dimensional type space.

The problem that this inline causes is that it couples two, otherwise
largely independent type spaces: 'struct mm_struct' and 'struct task_struct'.

Given a high enough count of such random couplings, and given the fact that any
two subsystems will have some method that connects them, it can be seen that
to be able to define arbitrary inline methods, we need to include pretty much all 
headers into 'super-headers' like sched.h or mm.h.

Pure types are simple constructs: they only depend on the particular types they
embedd. They dont depend on the types that happen to embedd them.

Same goes for constants: they are of a specific type, and hence are more similar
to the 'type' notion than the 'method' notion.

So regardless of how we call them, we want constants to be near the types they are
related to. They do not cause dependency hell, hence they can be in the _types.h
headers.

Another possibility would be to make a further distinction between 'local methods' 
and 'compound methods'. Local methods are the ones that only relate to a given
data type. Compound methods combine multiple types. We could allow local methods in 
type headers, and forbid compound methods.

	Ingo

  reply	other threads:[~2009-02-11 19:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 19:31 [GIT PULL] x86: more header untangling Jeremy Fitzhardinge
2009-02-11 10:03 ` Ingo Molnar
2009-02-11 17:01   ` Jeremy Fitzhardinge
2009-02-11 17:14     ` Ingo Molnar
2009-02-11 18:55       ` Jeremy Fitzhardinge
2009-02-11 19:47         ` Ingo Molnar [this message]
2009-02-11 22:34           ` Jeremy Fitzhardinge
2009-02-13 11:47             ` Ingo Molnar

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=20090211194719.GA25968@elte.hu \
    --to=mingo@elte.hu \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.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