Understanding the Linux Kernel, Third Edition

By Daniel P. Bovet, Marco Cesati

In order to entirely comprehend what makes Linux tick and why it really works so good on a large choice of platforms, you want to delve deep into the center of the kernel. The kernel handles all interactions among the CPU and the exterior international, and determines which courses will proportion processor time, in what order. It manages restricted reminiscence so good that hundreds of thousands of methods can proportion the approach successfully, and expertly organizes information transfers in order that the CPU is not stored ready any further than useful for the particularly sluggish disks.

The 3rd variation of Understanding the Linux Kernel takes you on a guided journey of the main major facts buildings, algorithms, and programming methods utilized in the kernel. Probing past superficial gains, the authors provide necessary insights to those who need to know how issues rather paintings within their computing device. very important Intel-specific positive factors are mentioned. suitable segments of code are dissected line through line. however the ebook covers greater than simply the functioning of the code; it explains the theoretical underpinnings of why Linux does issues how it does.

This version of the ebook covers model 2.6, which has obvious major alterations to just about each kernel subsystem, really within the components of reminiscence administration and block units. The ebook makes a speciality of the next topics:

  • Memory administration, together with dossier buffering, procedure swapping, and Direct reminiscence entry (DMA)
  • The digital Filesystem layer and the second one and 3rd prolonged Filesystems
  • Process construction and scheduling
  • Signals, interrupts, and the fundamental interfaces to machine drivers
  • Timing
  • Synchronization in the kernel
  • Interprocess communique (IPC)
  • Program execution

Understanding the Linux Kernel will acquaint you with the entire internal workings of Linux, yet it really is greater than simply an educational workout. you will study what stipulations carry out Linux's most sensible functionality, and you may see the way it meets the problem of delivering sturdy process reaction in the course of procedure scheduling, dossier entry, and reminiscence administration in a wide selection of environments. This booklet might help you're making the main of your Linux system.

Show description

Quick preview of Understanding the Linux Kernel, Third Edition PDF

Show sample text content

Maintains with the following timer within the record, if any. All timers within the record were dealt with. maintains with the following new release of the outermost whereas cycle. The outermost whereas cycle is terminated, which means all decayed timers were dealt with. In multiprocessor structures, units base->running_timer to NULL. Releases the base->lock spin lock and permits neighborhood interrupts. as the values of jiffies and timer_jiffies frequently coincide, the outermost whereas cycle is usually done just once. mostly, the outermost loop is carried out jiffies - base->timer_jiffies + 1 consecutive occasions.

If sufficient unfastened reminiscence is offered, the request may be chuffed instantly. differently, a few reminiscence reclaiming needs to ensue, and the kernel regulate direction that made the request is blocked till extra reminiscence has been freed. although, a few kernel keep watch over paths can't be blocked whereas inquiring for memory—this occurs, for example, while dealing with an interrupt or while executing code within a serious area. In those situations, a kernel keep watch over direction may still factor atomic reminiscence allocation requests (using the GFP_ATOMIC flag; see the later part "The Zoned web page body Allocator").

Desk 4-12. The fields of the cpu_workqueue_struct constitution box identify Description lock Spin lock used to guard the constitution remove_sequence series quantity utilized by flush_workqueue( ) insert_sequence series quantity utilized by flush_workqueue( ) worklist Head of the checklist of pending services more_work Wait queue the place the employee thread looking ahead to extra paintings to be performed sleeps work_done Wait queue the place the procedures looking ahead to the paintings queue to be flushed sleep wq Pointer to the workqueue_struct constitution containing this descriptor thread method descriptor pointer of the employee thread of the constitution run_depth present execution intensity of run_workqueue( ) (this box may perhaps develop into more than one while a functionality within the paintings queue record blocks) The worklist box of the cpu_workqueue_struct constitution is the top of a doubly associated record accumulating the pending services of the paintings queue.

6 shops reminiscence descriptors in info constructions known as red-black bushes . In a red-black tree, every one aspect (or node) often has young ones: a left baby and a correct baby. the weather within the tree are taken care of. for every node N, all parts of the subtree rooted on the left baby of N precede N, whereas, conversely, all components of the subtree rooted on the correct baby of N stick with N (see determine 9-3(a); the major of the node is written contained in the node itself. in addition, a red-black tree needs to fulfill 4 extra principles: each node has to be both crimson or black.

PG_writeback The web page is being written to disk by way of the writepage approach (see bankruptcy sixteen) . PG_nosave Used for approach suspend/resume. PG_compound The web page body is dealt with during the prolonged paging mechanism (see the part "Extended Paging" in bankruptcy 2). PG_swapcache The web page belongs to the change cache (see the part "The switch Cache" in bankruptcy 17). PG_mappedtodisk All facts within the web page body corresponds to blocks allotted on disk. PG_reclaim The web page has been marked to be written to disk so as to reclaim reminiscence.

Download PDF sample

Rated 4.97 of 5 – based on 26 votes