<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>codemonkey.org.uk &#187; kconfig</title>
	<atom:link href="http://codemonkey.org.uk/tag/kconfig/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkey.org.uk</link>
	<description>Dave Jones' Linux &#38; opensource stuff.</description>
	<lastBuildDate>Tue, 03 Jan 2012 14:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Hidden initcalls.</title>
		<link>http://codemonkey.org.uk/2008/12/26/hidden-initcalls/</link>
		<comments>http://codemonkey.org.uk/2008/12/26/hidden-initcalls/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 04:47:08 +0000</pubDate>
		<dc:creator>davej</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[kconfig]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://www.codemonkey.org.uk/?p=32</guid>
		<description><![CDATA[The boot tracing post I wrote up led me to scrutinise the dmesg a little further. There&#8217;s a ton of data in there, and not all of it makes sense. To call out one example.. [ 7.209578] calling snap_init+0&#215;0/0x2a @ 1 [ 7.215488] initcall snap_init+0&#215;0/0x2a returned 0 after 72 usecs What is this stuff doing [...]<p><a href="http://codemonkey.org.uk/2008/12/26/hidden-initcalls/">Hidden initcalls.</a> is a post from: <a href="http://codemonkey.org.uk">codemonkey.org.uk</a></p>



No related posts.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.codemonkey.org.uk/2008/12/25/boot-tracing/">boot tracing post I wrote up</a> led me to scrutinise the dmesg a little further.  There&#8217;s a ton of data in there, and not all of it makes sense.<br />
To call out one example..</p>
<blockquote><p>
[    7.209578] calling  snap_init+0&#215;0/0x2a @ 1<br />
[    7.215488] initcall snap_init+0&#215;0/0x2a returned 0 after 72 usecs
</p></blockquote>
<p>What is this stuff doing built into the vmlinuz?  This stuff is a prime candidate for being modular, given that not everyone needs it. (I&#8217;ll bet a majority of users don&#8217;t even know what it is, let alone &#8216;need&#8217; it).</p>
<p>This is defined in net/802/psnap.c   Looking at net/802/Makefile, we see this gets built providing one or more of the following CONFIG options are set..</p>
<blockquote><p>
obj-$(CONFIG_LLC)	+= p8022.o psnap.o<br />
obj-$(CONFIG_TR)	+= p8022.o psnap.o tr.o<br />
obj-$(CONFIG_IPX)	+= p8022.o psnap.o p8023.o<br />
obj-$(CONFIG_ATALK)	+= p8022.o psnap.o
</p></blockquote>
<p>Lets take these one by one.<br />
Here&#8217;s where the fail begins.  In the Fedora kernel, we had CONFIG_LLC set to =m. But something ends up overriding that decision, and making it a built-in. [note to self: make oldconfig shout when this happens].  Something must be &#8216;select&#8217;ing it somewhere.  There&#8217;s actually quite a few things that do. But it turns out that the culprit in this case is CONFIG_TR.  Wait, tokenring support is being built-in for every user ?<br />
Afraid so. And why this happens is a bit tragic.</p>
<p>Looking at the definition of CONFIG_TR in drivers/net/tokenring/Kconfig is enlightening.</p>
<blockquote><p>menuconfig TR<br />
        bool &#8220;Token Ring driver support&#8221;<br />
        depends on NETDEVICES &#038;&#038; !UML<br />
        depends on (PCI || ISA || MCA || CCW)<br />
        select LLC </p></blockquote>
<p>The &#8216;bool&#8217; being the key problem here.  Because TR ends up being built-in, all its dependencies and everything it selects also become built-ins.  Changing this to a tristate solves this, and LLC remains modular.</p>
<p>Problems like this are why I really loathe the &#8216;select&#8217; statement in kconfig.</p>
<p>The initcalls mentioned above were _tiny_ in comparison to some of the more obvious bloat, but there&#8217;s a bunch of low-hanging fruit in there like this which on first sight just leaves you wondering &#8216;wtf?&#8217;.</p>
<p><a href="http://codemonkey.org.uk/2008/12/26/hidden-initcalls/">Hidden initcalls.</a> is a post from: <a href="http://codemonkey.org.uk">codemonkey.org.uk</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://codemonkey.org.uk/2008/12/26/hidden-initcalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

