lkml.org 
[lkml]   [2009]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git-pull -tip] x86: include inverse Xmas tree patches

* Thomas Gleixner <tglx@linutronix.de> wrote:

> On Sun, 29 Mar 2009, Ingo Molnar wrote:
> > * Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > > > Personally I'd prefer alphabetic order, sorting based on length
> > > > isn't a complete ordering. Nearly all editors can sort
> > > > alphabetically at the push of a key.
> > >
> > > I'd prefer if somebody would sit down and write a tool to analyse
> > > the include hell instead of manually shuffling crap around to
> > > avoid trivial merge conflicts. I have cleaned up enough stuff in
> > > the x86 merger myself where I was able to cut the number of
> > > includes at least in half just by staring at the gcc intermediate
> > > files. We could do better and automate the analysis so we get down
> > > to a handful of includes instead of including the world and more.
> >
> > I do not disagree with include file cleanups (we've done many of
> > them in this cycle and in previous cycles), but note that the
> > reduction in include files at the top of .c files actually increases
> > the chance of patch conflicts: when a new include file is added by
> > two patches to the same .c file.
>
> Those conflicts are trivial and if we have a mechanism to anlyse
> include dependencies then we can avoid such conflicts often at
> all.

Yeah, i agree that least 50% of the existing #include's are not
needed.

That's not the point though. When two new files both append to the
#include file section, they'll clash. Those _new_ includes tend to
be justified - people dont add #includes needlessly - it's years
long bitrot that causes #includes to bloat up slowly.

> Go through some of the include madness and watch the compiler
> reading the same header file ten times for a single source file
> compile.

Yes, we need both efforts. That section needs to look professional
(unordered lines look amateurishly random, arbitrary and confusing),
and it needs to be minimalized as well.

And the xmas-tree helps the minimizing effort - as it trivially
eliminates duplicate #includes (which do happen frequently as well),
and they eliminate related includes as well because they get moved
together and get noticed.

Most importantly, such code needs to look like as if someone
actually cared about it. If code looks tidy, people assume that it's
supposed to be perfect, and will notice and fix more subtle
imperfections in it. If code looks totally messy on the other hand,
_nobody_ will care because it's visibly broken. So these changes are
a small step forward.

Ingo


\
 
 \ /
  Last update: 2009-03-29 01:03    [from the cache]
©2003-2011 Jasper Spaans