Linux Kernel in a Nutshell - FREE

If it doesn't relate to Debian, but you still want to share it, please do it here

Linux Kernel in a Nutshell - FREE

Postby mzilikazi » 2007-01-12 16:37

Nope not a joke.
http://www.kroah.com/lkn/

License
This book is available under the terms of the Creative Commons Attribution-ShareAlike 2.5 license. That means that you are free to download and redistribute it. The development of the book was made possible, however, by those who purchase a copy from O'Reilly or elsewhere.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: Linux Kernel in a Nutshell - FREE

Postby Lost Dog » 2007-01-12 17:17

mzilikazi wrote:Nope not a joke.
http://www.kroah.com/lkn/

License
This book is available under the terms of the Creative Commons Attribution-ShareAlike 2.5 license. That means that you are free to download and redistribute it. The development of the book was made possible, however, by those who purchase a copy from O'Reilly or elsewhere.


I downloaded this the other day and spent last evening trying to strip down my 2.6.19.2 kernel to the bare minimum. It has some pretty good information on customizing the kernel.

I've got everything working except CDROM support (Pioneer DVR-111). I broke that somehow and now I'm trying to track down what I need to activate in the kernel to get it working again.

One thing I never knew was using the -j modifier during "make" to specify the number of threads to use. Speeds up compiling quite a bit with my dual core chip!

For compiling kernels I use make-kpkg rather than make but make-kpkg does not have the -j modifier. Is there something similar?
User avatar
Lost Dog
 
Posts: 250
Joined: 2006-08-11 21:54
Location: North of the Columbia River

Postby garrincha » 2007-01-12 18:25

At first I thought that it was the famed O'Reilly reference Linux in a Nutshell that I usually browse through whenever I'm in my local bookstore, but upon closer examination I was mistaken as it is about ikernel. Still, I downloaded the tarball, just read the first few chapters -- it is quite good and informative.

Thanks for the link mzilikazi.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Re: Linux Kernel in a Nutshell - FREE

Postby mzilikazi » 2007-01-12 18:27

Lost Dog wrote:For compiling kernels I use make-kpkg rather than make but make-kpkg does not have the -j modifier. Is there something similar?

man make-kpkg
/snip/
CONCURRENCY_LEVEL
If defined, this environment variable sets the concurrency level of make used to compile the kernel and the modules set using
-j flags to the sub make in the build target of make-kpkg. Should be a (small) integer, if used. You can get the current num-
ber of CPUs using the command:
"grep -c '^processor' /proc/cpuinfo" WARNING: Do NOT set the -j option in MAKEFLAGS directly, this shall call the build to
fail.


So you could do:
Code: Select all
export CONCURRENCY_LEVEL=2
fakeroot make-kpkg blah blah blah


Or even add it to /etc/environment:

Code: Select all
LANG=C
CONFIG_SMP=y
CONCURRENCY_LEVEL=2


This is just what google told me. I don't even have access to a dual core machine to test on. Please report back if you don't mind.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby mzilikazi » 2007-01-12 18:37

Just thought I'd toss this link in here for completeness. The Debian Linux Kernel Handbook.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: Linux Kernel in a Nutshell - FREE

Postby Lost Dog » 2007-01-13 01:17

mzilikazi wrote:So you could do:
Code: Select all
export CONCURRENCY_LEVEL=2
fakeroot make-kpkg blah blah blah


Or even add it to /etc/environment:

Code: Select all
LANG=C
CONFIG_SMP=y
CONCURRENCY_LEVEL=2


This is just what google told me. I don't even have access to a dual core machine to test on. Please report back if you don't mind.


Ok, I just gave it a try... Before when compiling a kernel my CPU load would be near 90% on one kernel and 10% on the other it would fluctuate between the two. After using export CONCURRENCY_LEVEL both cores are pegged at 100%.

I need to write a little script that will export the time, start the compile then export the time once the job is done.... I could do that and compare the two and see a difference in compile time.
User avatar
Lost Dog
 
Posts: 250
Joined: 2006-08-11 21:54
Location: North of the Columbia River

Re: Linux Kernel in a Nutshell - FREE

Postby ajdlinux » 2007-01-13 01:24

Lost Dog wrote:I need to write a little script that will export the time, start the compile then export the time once the job is done.... I could do that and compare the two and see a difference in compile time.


i.e. something like the 'time' command?
Jabber: xmpp:ajdlinux@jabber.org.au
Spammers, email this: ajdspambucket@exemail.com.au
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Re: Linux Kernel in a Nutshell - FREE

Postby Lost Dog » 2007-01-13 01:53

ajdlinux wrote:
Lost Dog wrote:I need to write a little script that will export the time, start the compile then export the time once the job is done.... I could do that and compare the two and see a difference in compile time.


i.e. something like the 'time' command?


Actually, it's "date". The problem is getting the time output before and after the compile. At any rate, here are the results!

This is with a AMD X2 4400+ with 1 gig of memory.

I compiled the same kernel twice:

export CONCURRENCY_LEVEL=4
Start: 17:31:38
Finish: 17:36:02
Total time: 4 minutes, 24 seconds.

No CONCURRENCY_LEVEL set
Start: 17:37:48
Finish: 17:45:23
Total time: 7 minutes, 35 seconds.

NOT TOO BAD!
User avatar
Lost Dog
 
Posts: 250
Joined: 2006-08-11 21:54
Location: North of the Columbia River

Re: Linux Kernel in a Nutshell - FREE

Postby ajdlinux » 2007-01-13 02:17

Lost Dog wrote:
ajdlinux wrote:
Lost Dog wrote:I need to write a little script that will export the time, start the compile then export the time once the job is done.... I could do that and compare the two and see a difference in compile time.


i.e. something like the 'time' command?


Actually, it's "date". The problem is getting the time output before and after the compile. At any rate, here are the results!


'time' actually times the command given as an argument, so you could run it like:

Code: Select all
export CONCURRENCY_LEVEL=2
time fakeroot make-kpkg kernel_image


It would output in the form 'real, user, sys' and give the times.
Jabber: xmpp:ajdlinux@jabber.org.au
Spammers, email this: ajdspambucket@exemail.com.au
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Re: Linux Kernel in a Nutshell - FREE

Postby Lost Dog » 2007-01-13 02:31

ajdlinux wrote:
It would output in the form 'real, user, sys' and give the times.


I guess that would have been much easier than what I did :D

I just did another compile (finally figured out my CDROM issues and got that compiled in) and the result was about the same at 5 min 25 second (but this was compiling in some SCSI stuff as well).
User avatar
Lost Dog
 
Posts: 250
Joined: 2006-08-11 21:54
Location: North of the Columbia River

Postby michael7 » 2007-01-17 22:36

Thanks for the link. I downloaded the book, read it and decided I wanted a copy. So, I ordered it from amazon for about $20. Heck, chapters 7 and 8 are worth that!
Live simply so that others may simply live.
Debian Social Contract
User avatar
michael7
 
Posts: 125
Joined: 2005-05-14 22:33

Postby graysky » 2008-12-14 11:17

I usually don't like to bring up old threads, but for CONCURRENCY_LEVEL, it's my understanding that the number you assign should be one + "the number of cores."

For dual core chips:
# export CONCURRENCY_LEVEL=3

For quad core chips:
# export CONCURRENCY_LEVEL=5

I dunno about hyperthreading CPUs like the old P4 or new i7... maybe you'd want to treat each hyperthread as a core thus using a value of 9.
User avatar
graysky
 
Posts: 495
Joined: 2008-10-10 20:58

Postby BioTube » 2008-12-14 15:24

4 seems to work well on my machine. Brings everything else to a (usable)crawl, but definitely speeds things up. Of course, I'm not too sure the effect of running too many concurrent jobs.
Image
Ludwig von Mises wrote:The elite should be supreme by virtue of persuasion, not by the assistance of firing squads.
User avatar
BioTube
 
Posts: 7551
Joined: 2007-06-01 04:34


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable