Title: Linux Kernel Development
Author: Robert Love
ISBN: 0-672-32512-8
Publisher: SAMS
Reviewer: Richard Dawe
Linux Kernel Development's subtitle is "a practical guide to the design
and implementation of the Linux kernel" and that's a good description
of the book. It gives an overview of the key areas of the Linux 2.6 kernel:
process management, scheduling, interrupt handlers, synchronisation
(locks, etc.), time, memory management, files and filesystems,
memory mappings.
I would say prerequisites for understanding this book are
basic computer science concepts: some knowledge of how processors work -
caches, logical vs. physical memory, what a page fault is, etc;
processes vs. threads. The author does explain concepts such as
interrupts, but an awareness of these things will allow the reader
to concentrate on the kernel itself. Some familiarity with C may also help.
The author's knowledge, passion and excitement about the kernel
show greatly and make this an enjoyable, easy-to-follow and compelling
read. (I have to admit that I've been wanting to get into kernel
programming for some time and follow Kernel Traffic and KernelTrap
avidly. So maybe I'm biased.)
Some of the algorithms are quite heavy going (e.g.: for scheduling).
In most cases the author gives a detailed explanation, takes a step back,
then provides a short re-explanation - I found this to be very helpful.
It's not the kind of book that you can pick up and start reading
at any point. The various chapters on subsystems of the kernel are grouped,
so it's possible to, say, start at the time chapter or the interrupt
handling chapter or read just about memory management.
I was glad to finally read an explanation of what the slab memory allocator
is and how it works. (I guess I could have looked at the source before,
if I really wanted to know.) I found the section on locking interesting:
there are many types of locking available in the kernel (especially in 2.6)
and the pros and cons of each were well explained.
The book is about the Linux 2.6 kernel, but it does mention the old ways
of doing things in Linux 2.4 and the reasons for the new ways. I found
this in itself quite interesting.
I learnt a lot from reading this book and I'm very glad that I read it.
I've already applied some of the knowledge in my normal application
development on Linux at work. I've always found knowing what happens
at lower-levels helps at the level I'm programming.
I do have a couple of criticisms of the book:
* In the section on filesystems (the VFS) it was hard to tell
the relationships between all the VFS-related data structures.
It would have been nice to have a high-level description
of how a new filesystem would be written.
* I would have liked to see more about the networking aspects
of the Linux kernel. I suppose this isn't as core a subsystem as,
say, memory allocation or filesystems, but no computer is an island
these days.
If you're looking to do some kernel hacking or just interested
in how the Linux kernel works, then I'd recommend reading this book.
But you won't become a kernel programmer just by reading this book. After
reading this book I started working on a filesystem and found it hard going!
But after reading this book, I feel like I have a firm foundation.
Richard Dawe 2004-01-31