2007-08-24 20:17:41

by Rob Landley

[permalink] [raw]
Subject: What's up with CONFIG_BLK_DEV?

CONFIG_BLOCK disables the block layer.
CONFIG_BLK_DEV disables the block devices.

Is there _ever_ a time you want the block layer but no block devices?

(I ask because this is the first time I've had to add a symbol to my User Mode
Linux miniconfig since 2.6.12, and I can't figure out what the actual purpose
of this symbol is.)

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.


2007-08-24 20:34:54

by Jan Engelhardt

[permalink] [raw]
Subject: Re: What's up with CONFIG_BLK_DEV?


On Aug 24 2007 15:17, Rob Landley wrote:
>
>CONFIG_BLOCK disables the block layer.
>CONFIG_BLK_DEV disables the block devices.

menuconfig BLK_DEV
bool "Block devices"
depends on BLOCK
default y
---help---
Say Y here to get to see options for various different block device
drivers. This option alone does not add any kernel code.

If you say N, all options in this submenu will be skipped and disabled
only do this if you know what you are doing.


Jan
--

2007-08-24 20:37:09

by Jan Engelhardt

[permalink] [raw]
Subject: Re: What's up with CONFIG_BLK_DEV?


On Aug 24 2007 22:34, Jan Engelhardt wrote:
>On Aug 24 2007 15:17, Rob Landley wrote:
>>
>>CONFIG_BLOCK disables the block layer.
>>CONFIG_BLK_DEV disables the block devices.
>
>menuconfig BLK_DEV
> bool "Block devices"
> depends on BLOCK
> default y
> ---help---
> Say Y here to get to see options for various different block device
> drivers. This option alone does not add any kernel code.
>
> If you say N, all options in this submenu will be skipped and disabled
> only do this if you know what you are doing.

>>Is there _ever_ a time you want the block layer but no block devices?

Well, where do you think your hard disk drivers come from? Definitely
not from the BLK_DEV menu...



Jan
--

2007-08-26 06:08:41

by Rob Landley

[permalink] [raw]
Subject: Re: What's up with CONFIG_BLK_DEV?

On Friday 24 August 2007 3:36:54 pm Jan Engelhardt wrote:
> On Aug 24 2007 22:34, Jan Engelhardt wrote:
> >On Aug 24 2007 15:17, Rob Landley wrote:
> >>CONFIG_BLOCK disables the block layer.
> >>CONFIG_BLK_DEV disables the block devices.
> >
> >menuconfig BLK_DEV
> > bool "Block devices"
> > depends on BLOCK
> > default y
> > ---help---
> > Say Y here to get to see options for various different block
> > device drivers. This option alone does not add any kernel code.
> >
> > If you say N, all options in this submenu will be skipped and
> > disabled only do this if you know what you are doing.
> >
> >>Is there _ever_ a time you want the block layer but no block devices?
>
> Well, where do you think your hard disk drivers come from? Definitely
> not from the BLK_DEV menu...

Actually I hadn't looked that far into it. Juggling seven things yesterday
and offline most of today, and what I actually _noticed_ was that my
miniconfig that had worked unchanged to build UML since 2.6.12 finally broke
on a kernel upgrade, and I have no idea what the actual reason for the change
is other than possibly aesthetics. Oh well.

Now that I look I see that all the devices in this menu (at least in User Mode
Linux) are actually virtual block devices (UBD, loopback, and ramdisk), which
the menu help doesn't indicate.

Now I'm trying to think of a better user interface way of cross-referencing
this sort of thing. Network block devices live in the networking menu,
device drivers for hardware live off in another menu. What I really want is
a way to dynamically create menus via search critiera: "Show me all the block
devices"...

Also "here's a symbol, show me a menu containing everything else that is
either required by or enabled by this symbol..." That sounds like a more
powerful abstraction, since the previous one is "show me everything that
depends on CONFIG_BLOCK".

(I wonder if this would be a largeish rewrite of the menuconfig
infrastructure? Hmmm...)

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.

2007-08-26 07:41:46

by Jan Engelhardt

[permalink] [raw]
Subject: Re: What's up with CONFIG_BLK_DEV?


On Aug 26 2007 01:08, Rob Landley wrote:
>On Friday 24 August 2007 3:36:54 pm Jan Engelhardt wrote:
>> >>Is there _ever_ a time you want the block layer but no block devices?
>>
>> Well, where do you think your hard disk drivers come from? Definitely
>> not from the BLK_DEV menu...
>
>Now that I look I see that all the devices in this menu (at least in User Mode
>Linux) are actually virtual block devices (UBD, loopback, and ramdisk), which
>the menu help doesn't indicate.

Nah, BLK_DEV is like MISC_DEV. There's all sort of stuff in it, _not only_
virtual things. FLOPPY comes to mind.


Jan
--

2007-09-01 23:47:47

by Oleg Verych

[permalink] [raw]
Subject: kconfig/kbuild rewite (Re: What's up with CONFIG_BLK_DEV?)

* Sun, 26 Aug 2007 01:08:28 -0500
* Organization: Boundaries Unlimited
>
[]
> Also "here's a symbol, show me a menu containing everything else that is
> either required by or enabled by this symbol..." That sounds like a more
> powerful abstraction, since the previous one is "show me everything that
> depends on CONFIG_BLOCK".
>
> (I wonder if this would be a largeish rewrite of the menuconfig
> infrastructure? Hmmm...)

Yess. I'm doing this, actually. Sam, Andrew and Linus have got an email
half a year ago about my intent. Tried to release 2.6.20-j4f, but that
was just a dream. Now i did some training in non-kernel related stuff and
always catch (30k, 14k) LKML backlogs to stay in tune. Some bits i
get are here ftp://flower.upol.cz/Linux/info-LKML/tools/

So, ideas: UI, organization, efficiency, simplicity, etc. are welcome.

Maybe in one month i'll get something to show (base is 2.6.22).
Imagination plays very well, the thing must be ground shaking, but i'll
see how it will fit reality. Yours one in consideration from very
beginning, don't bother :)

Another problem that i have to solve before any publishing (it's
completely another tree, logic, interface), is the work tracking system,
i was describing in June. This is important, because i sick of current
chaos and manual organizing work in-tree or in regression tracking.
____

2007-09-02 11:50:37

by Sam Ravnborg

[permalink] [raw]
Subject: Re: kconfig/kbuild rewite (Re: What's up with CONFIG_BLK_DEV?)

On Sun, Sep 02, 2007 at 02:02:37AM +0200, Oleg Verych wrote:
> * Sun, 26 Aug 2007 01:08:28 -0500
> * Organization: Boundaries Unlimited
> >
> []
> > Also "here's a symbol, show me a menu containing everything else that is
> > either required by or enabled by this symbol..." That sounds like a more
> > powerful abstraction, since the previous one is "show me everything that
> > depends on CONFIG_BLOCK".
> >
> > (I wonder if this would be a largeish rewrite of the menuconfig
> > infrastructure? Hmmm...)
>
> Yess. I'm doing this, actually. Sam, Andrew and Linus have got an email
> half a year ago about my intent. Tried to release 2.6.20-j4f, but that
> was just a dream. Now i did some training in non-kernel related stuff and
> always catch (30k, 14k) LKML backlogs to stay in tune. Some bits i
> get are here ftp://flower.upol.cz/Linux/info-LKML/tools/
>
> So, ideas: UI, organization, efficiency, simplicity, etc. are welcome.
>
> Maybe in one month i'll get something to show (base is 2.6.22).
> Imagination plays very well, the thing must be ground shaking, but i'll
> see how it will fit reality. Yours one in consideration from very
> beginning, don't bother :)
Then as now you have not yet expalined what you are trying to do.
Nevertheless I look forward for a minmal set of patches that improve
whatever you are working with.

As for Kconfig the low hanging fruits are not in the tools but in the
structure of the Kconfig files. There are a lot that can be improved
with a decent effort but nobody has stepped up doing so.
The tools could be better too but if the root problem is the structure
of the Kconfig files this is where we should focus and not on the tools.

For Kbuild I fail to see anything that demand a rewrite from a structure
view of the Kbuild files.
The Kbuild internal stuff is antoehr story - here a rewrite to a saner
language then GNU make syntax could improve hackability a lot.

Sam

2007-09-03 21:34:12

by Oleg Verych

[permalink] [raw]
Subject: Re: kconfig/kbuild rewite (Re: What's up with CONFIG_BLK_DEV?)

On Sun, Sep 02, 2007 at 01:51:50PM +0200, Sam Ravnborg wrote:
[]
> Then as now you have not yet expalined what you are trying to do.
> Nevertheless I look forward for a minmal set of patches that improve
> whatever you are working with.

Yes, because it's LKML, that wants not-hand-waving stuff in first
place. But recent kevent, scheduler stuff shows
inflexibility/agendas, though.

That examples were bad WRT kernel production infrastructure. Even then i
doubt, i must waste everyone's time with details, only goals.

> As for Kconfig the low hanging fruits are not in the tools but in the
> structure of the Kconfig files. There are a lot that can be improved
> with a decent effort but nobody has stepped up doing so.
> The tools could be better too but if the root problem is the structure
> of the Kconfig files this is where we should focus and not on the tools.

In my view this all interconnected. Designing flexible and easy
configuration system yields dramatic changes to the build one as well.

* profiles non/debug, non/production

* per file, per algorithm tuning
* efficiency
* choosing structure sizes
* selecting fast/slow paths
* per case choosing need/dead code
* various parameters
* optimization
* per compiler/version
* option profiles
* feature/warning sets
* linker
* is there anything alternative?

* distributed development
* open possibility to work in any part of the tree
* making changes and quickly having
* config (dependency, etc.) set/UI ready
* per profile/option test builds
(e.g. making return->goto or loop change and quickly getting -O0,
-O2, -Os images; check size; have userspace testing skeleton -> have
runtime test)
* integration with quilt-like source/patch managers ``here''
* allow per architecture development
* small source tree
* developer's profiles, that will have exact feature/tuning/build
config options results for everybody within given source tree version
(for easy testing, but not "send me your .config; what binutils?..")

* base set of tools to have easy to configure alternatives
* shell
to use basic POSIX (plus accepted, not NIH like in bash) features
(i have some examples; unfortunately even basic set behaves
differently and buggy)
* make
stat() wrapper executing shell everywhere; of course there are
some features, but anyway, interface for it and the like is needed
* perl/python/ruby
establish text processing rules
* coreutils/busybox/etc
non is perfect, having replacement mechanism allows faster debug
and enhancement of their own development and testing

* UI
(maybe next time)

Only one thing. I don't have time and will to study all that
ncurses/slang/qt/gtk/AJAX/whatever stuff. I wanted to do basic terminal
or text/stream editor friendly user interface. As for the former, i
just upset about software capabilities of the todays terminal
emulators. I'm fine with exchanging escape sequences, but all that
inherited TEKTRONIX 4010, APL, HP2645, Microterm ACT-IV, Ann Arbor
4080, LSI ADM-3a (man terminfo) legacy without even a hint of progress
last 20 years is just dead.

I likely to end up with shell script generation, that will be
available for everybody who knows shell and have ordinary text editor.

autoconf/configure inside out? Maybe, but at least from the new sheet of
paper, with good background in history and basic text processing tools.

Just in case anybody cares about how ugly modern software development is
(INA software industry dude, and may be just crazy, of course). Well,
recent Rusty's gig may give a clue, how things may look different.

> For Kbuild I fail to see anything that demand a rewrite from a structure
> view of the Kbuild files.
> The Kbuild internal stuff is antoehr story - here a rewrite to a saner
> language then GNU make syntax could improve hackability a lot.
____

2007-09-04 05:02:18

by Rob Landley

[permalink] [raw]
Subject: Re: kconfig/kbuild rewite (Re: What's up with CONFIG_BLK_DEV?)

On Sunday 02 September 2007 6:51:50 am Sam Ravnborg wrote:
> As for Kconfig the low hanging fruits are not in the tools but in the
> structure of the Kconfig files. There are a lot that can be improved
> with a decent effort but nobody has stepped up doing so.
> The tools could be better too but if the root problem is the structure
> of the Kconfig files this is where we should focus and not on the tools.

On a semi-related note, I recently wrote a dumb little minimal python parser
that converted all the menuconfig help to html:

http://kernel.org/doc/menuconfig
http://kernel.org/doc/make/menuconfig2html.py

I did this by ignoring half of the structure of the files (I was only
interested in the help text), but it occurs to me that my current script to
create miniconfig files by repeatedly calling "allnoconfig":
http://landley.net/hg/firmware/file/fe0e5b641cb4/sources/toys/miniconfig.sh

Could probably be replaced by a python script to read the .config, parse the
kconfig, understand the dependencies, and spit out the miniconfig, without
_too_ much effort.

I'll throw it on the todo heap after the other 12 projects I hope to get to
this month...

> For Kbuild I fail to see anything that demand a rewrite from a structure
> view of the Kbuild files.
> The Kbuild internal stuff is antoehr story - here a rewrite to a saner
> language then GNU make syntax could improve hackability a lot.

I agree about getting away from make, but I arrived at the conclusion from a
different perspective. I believe make is starting to outlive its usefulness.

Rampant opinion follows:

Incremental builds are a developer convenience. Users who download the source
code to open source projects but who aren't modifying the project tend to
do "make all", and nothing else. Source build systems like gentoo generally
don't have any "rebuild several variants of the same package incrementally"
option, and for many packages changing configuration requires a "make clean"
anyway. (Since make doesn't handle configuration dependencies, anybody who
_does_ make that work without an intervening make clean implemented extensive
infrastructure of their own, on top of make.) As far as release versions are
concerned, all make provides is an expected user interface (./configure;
make; make install). The infrastructure to calculate dependencies (make's
reason to exist) is essentially useless during deployment of release
versions.

For 90% of the software packages out there, "make all" takes less than 10
seconds on modern hardware. Sometimes the ./configure step takes longer to
run than the actual build. (The kernel is not one of these packages, but the
kernel is probably the largest open source software development effort in
history, at least in terms of the number of developers involved if not
absolute code size.) So for all but the largest and most complicated
software packages, make doesn't even significantly improve the lives of
developers. And those large software packages tend to either reimplement
make (XFree86 had ibuild, KDE did cmake, Apache has ant...) because for
_large_ packages, make sucks. Kbuild can be seen as yet another such
reimplementation, in this case built on top of gnu make rather than by
replacing it.

The most efficient way to build software these days is to feed all the .c
files to gcc in one go, so the optimizer can work on the entire program in
one big tree. This can give up about 10% smaller and faster code, assuming
you have a few hundred megs of ram which essentially all new development
systems do. It's also faster to do this than to do a normal "make all"
because you don't re-exec gcc lots of times, and can stay cache-hot more. So
for deployment builds, eliminating the granularity of make and batching the
compile into larger chunks is functionally superior. This reduces make's job
to "call gcc once for each output binary, then do any fancy linker stuff".

Intermediate levels of granularity are available, for example the linux kernel
source code already produces one .o file per directory (built-in.o). It
could compile a directory at a time rather than a file at a time, and check
that this one .o file is newer than every other file in the directory or else
rebuild it, improving efficiency and reducing build complexity without
requiring full 4-minute rebuilds. This is the same kind of "more intelligent
batching" optimization people were doing back in the days of reel-to-reel
tape. Ask Maddog about it sometime, he's got great stories. :)

Using a faster non-optimizing compiler (like tcc) can build even large
projects like the entire Linux kernel in the 10 second range. (For example,
http://fabrice.bellard.free.fr/tcc/tccboot.html took 15 seconds to compile
the linux kernel on a Pentium 4. A modern 64-bit core 2 duo is noticeably
faster than this.) The resulting code has some downsides (inefficient, and
tcc isn't finished yet: I'm still working on getting tcc to build an
unmodified current kernel which is why I haven't seriously pushed for
adoption of this strategy yet) but it shows that there are other tools
capable of speeding up development builds, as much or more than "make" can.

Make itself was never an elegant tool. The significance of invisible
whitespace (tabs vs spaces) is only a minor annoyance compared to the design
flaw of mixing declarative and imperative flow control within the same syntax
(fundamental problem: you can't assign to a make variable within a target),
which leads to widespread use of recursive make to try to keep _some_ control
over the order of events (see "Recursive make considered harmful" at
http://aegis.sourceforge.net/auug97.pdf ), and then there's the
incompatability between different make versions (even different releases of
GNU Make). Modifying makefiles thus becomes a highly non-obvious activity
constituting its own area of expertise. But if you aren't interested in
dependency calculation (or only directory-level dependency calculation) and
are willing to let all makes be "make all", then most makefiles could be
written as a small, linear shell script.

I think that for 90% of the software packages out on freshmeat and sourceforge
today, make is already dead weight kept in place by tradition. I freely
admit this is an opinion, but I doubt it'll become _less_ true in future.

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.