Index

64-bit atomic operations, 180-181

A

absolute time, 207

abstraction layer, VFS (Virtual Filesystem), 262-263

account_process_tick() function, 219

action modifiers, gfp_mask flags, 239-240

action string, Kernel Event Layer, 361

activate task() function, 61

address intervals

creating, 318-320

removing, 320

address_space object, page caches, 326-328

address_space operations, page caches, 328-330

Advanced Programming in the UNIX Environment, 409

advisory locks, 166

AIX (IBM), 2

algorithms, 109-111

asymptotic behavior, 109

big-o notation, 109

big-theta notation, 109-110

clairvoyant, 325

complexity, 109-110

time complexity, 110-111

listing of, 110-111

process scheduler, 46-50

scalability, 109

scheduling algorithms, priority-based scheduling, 44

alignment of data, 386-387

issues, 387

nonstandard types, 387

structure padding, 387-389

alloc pages() function, 236, 259

alloc_page() function, 236

alloc_percpu() function, 258

allocating

memory, 237-244

memory descriptor, 308

process descriptors, 25-26

UIDs (unique identification numbers), 101-102

which method to use, 259

allocating memory, 231, 237, 260

choosing method, 259

high memory mappings, 253

permanent mappings, 254

temporary mappings, 254-255

kfree() function, 243-244

kmalloc() function, 238-244

gfp_mask flags, 238-243

pages, 231-232

obtaining, 235-237

per-CPU allocations, 255-256

slab layers, 245-246

design, 246-249

interface, 249-252

statically allocating on stack, 252-253

vmalloc() function, 244-245

zones, 233-235

allow interrupts flag, 127

anonymous mapping, 318

Anticipatory I/O scheduler, 302-303

APIC timer, 217

APIs

system calls, 70

UNIX Network Programming, 409

applications

hardware, relationship, 6

interrupt handlers, writing, 118-119

kernel, relationship, 6

arch directory, kernel source tree, 13

arguments, system calls, 71

arrays, per-CPU data, 255

Art of Computer Programming, The, Volume 1, 409

assembly, inline assembly, 19

asserting bugs, 370-371

associative arrays. See maps

asymptotic behavior, algorithms, 109

asynchronous interrupts, 114

atomic context, 115

atomic high memory mappings, 254-255

atomic operations, synchronization methods, 175

64-bit operations, 180-181

bitwise operations, 181-183

converting, 177

counter implementation, 177

defining, 177

increments, 175-176

integer operations, 176-179

interfaces, 176

nonatomic bit operations, 183

overhead advantages, 179

testing, 177

atomic_t data type, 384

atomicity, ordering, compared, 179

B

Bach, Maurice, 407

backing stores, 323

balanced binary search trees, self-balanced binary search trees

rbtrees, 106-108

red-black trees, 105-106

barrier operations, ordering, 179

barrier() function, 206

barriers

functions, 204-205

memory reads/writes, 203-206

bdflush kernel thread, 333-334

behaviors, system calls, 71-72

Bell Laboratories, Unix developmental history, 1

Benvenuti, Christian, 408

Berkeley Software Distributions (BSD), 2

BH interface, tasklets, 148

bh_state flags (buffers), 292

big-endian byte ordering, 389-391

big-o notation, 109

big-theta notation, 109-110

binary searching, git source management tool, 376-377

binary semaphores, 191-192

binary trees, 103-104

BSTs (binary search trees), 104

self-balanced binary search trees, 105

rbtrees, 106-108

red-black trees, 105-106

binding system calls, 79-81

bio structure, block I/O layer, 294-295

bitwise atomic operations, 181-183

BKL (Big Kernel Lock), 198-199

block device nodes, 337

block devices, 289-290, 337

buffer heads, 291

buffers, 291-294

sectors, 290-291

block directory, kernel source code, 13

block I/O layer, 290

bi_cnt field, 296

bi_idx field, 296

bi_io_vecs field, 295

bi_private field, 296

bi_vcnt field, 295

bio structure, 294-295

I/O vectors, 295-296

segments, 294

versus buffer heads, 296-297

blocks, 289-290, 337

BLOCK_SOFTIRQ tasklet, 140

BogoMIPS value, 227

Booleans, 14

Bostic, K., 408

bottom halves

disabling, 157-159

interrupt handlers, 115, 133-135

benefits, 134-135

BH interface, 135-136

task queues, 135

locking between, 157

mechanism selection criteria, 156-157

softirqs, 136-141

spin locks, 187-188

tasklets, 136, 142-148

version terminology, 137

work queues, 149-156

braces, coding style, 398-399

branch annotation, GNU C, 19-20

BSTs (binary search trees), 104

buffer caches, 330-331

buffers, blocks, 291-294

bug reports, submitting, 403-404

BUG() routine, 370

BUG_ON() routine, 370

bugs

asserting, 370-371

range of, 364

reproducing, 363-364

building

Booleans, 14-15

kernel, 13-16

modules, 340-342

noise minimization, 15

spawning multiple jobs, 16

busy looping, timers, 225-226

byte ordering, 389-391

C

C library, 5

system calls, 70-71

C Programming Language, The, 399, 409

C++-style comments, 400

cache eviction, 324-325

cache hits, 323

cache misses, 323

caches, 246

cache miss, 323

caching

backing stores, 323

buffer caches, 330-331

cache eviction, 324-325

cache hits, 323

page cache, 324

page caches, 323-326

address_space object, 326-328

address_space operations, 328-330

global hash, 330

radix tree, 330

page caching, filesystem files, 326

write caching, 324

write-through caches, 324

cdevs. See character devices

CFQ (Complete Fair Queuing) I/O scheduler, 303

CFS Schedulers, 172

character device nodes, 337

character devices, 289, 337

characters, word size, 381

child tasks, reparenting, 38

Choffnes, David R., 407

circular linked lists, 86-87

clairvoyant algorithm, 325

classes, process scheduler, 46-47

cli() function, 128

clocks, real-time clock (RTC), 217

clone() function, flags, 34-35

clone() system call, 32-34

clusters, 290

coarse locking, 172

code, interrupt-safe code, 168

codes, locks, compared, 186

coding style

braces, 398-399

comments, 400-401

consistency, 396

existing routines, 402

fixing ex post facto, 403

functions, 400

ifdef preprocessor directives, 402

importance of, 396

indention, 396

line length, 399-400

naming conventions, 400

productivity, 396

spacing, 397-398

structure initializers, 402-403

switch statements, 396-397

typedefs, 401

commands

modprobe, 343

SysRq, 371

Comments, coding style, 400-401

community help resources, debugging, 377

complete() function, 198

Completely Fair Scheduler, 43

completion variables, 197-198

concurrency

causes, 167

interrupts, 167

kernel, 21

kernel preemption, 167

pseudo-concurrency, 167

sleeping, 167

softirqs, 167

symmetrical multiprocessing, 167

tasklets, 167

true concurrency, 167

concurrent programming, threads, 33

cond_resched() function, 226

condition variables, debugging, 374

conditionals, UIDs, 373-374

CONFIG options, 168

configuration, kernel, 14-15

configuration options, modules, managing, 344-346

congestion, avoiding with multiple threads, 334-335

contended threads, 184

contention, locks, 171

context

interrupts, 115

processes, 29

system calls, 78-81

context switch() function, 62

context_switch() method, 380

context switching, process scheduler, 62

controlling interrupts, 127-130

converting atomic operations, 177

Cooper, Chris, 408

cooperative multitasking, process scheduler, 41-42

copy-on-write (COW) pages, 31

copy_process() function, 32

Corbet, Jonathan, 408

counters, implementing, atomic operations, 177

counting semaphores, 191-192

COW (copy-on-write) pages, 31

CREDITS file, 403

critical regions, multiple threads of execution, 162

crypto directory, kernel source tree, 13

ctime() library call, 221

current date and time, 207, 220-221

CVS, 11

cylinders, 290

D

D-BUS, Kernel Event Layer, 361

data section (processes), 23

data structures

binary trees, 103-104

BSTs (binary search trees), 104

self-balanced binary search trees, 105-108

choosing, 108

filesystems, 285-288

freeing, slab layers, 245-252

linked lists, 85

adding a node to, 90-91

circular linked lists, 86-87

defining, 89-90

deleting a node from, 91-92

doubly linked lists, 85-86

iterating through backward, 94

iterating while removing, 95

kernel implementation, 88-90

manipulating, 90-92

moving nodes, 92

navigating through, 87-88

singly linked lists, 85-86

splicing nodes, 92

traversing, 93-96

maps, 100-101

UIDs (unique identification numbers), 100-103

queues, 96-97

creating, 97-98

dequeuing data, 98

destroying, 99

enqueuing data, 98

kfifo, 97-100

obtaining size of, 98

resetting, 99

VFS (Virtual Filesystem), 265-266

data types

atomic_t, 384

char, 386

dev_t, 384

explicitly sized data types, 385-386

gid_t, 384

opaque data types, 384

pid_t, 384

portability, 384

special data types, 384-385

uid_t, 384

usage rules, 384

deactivating timers, 223

Deadline I/O scheduler, 300-302

deadlocks

ABBA, 170

threads, 169-171

debuggers in-kernel debugger, 372-373

debugging, 363-364, 378

atomicity, 370

binary searching, 376-377

BUG() routine, 370

bugs

asserting, 370-371

reproducing, 363-364

community help resources, 377

condition variables, 374

difficulty of, 363

dump information, 370-371

dump stack() routine, 371

kernel options, 370

Magic SysRq key commands, 371-372

occurrence limiting, 375-376

oops, 367-369

kallsyms, 369-370

kysmoops, 369

panic() routine, 371

printing, 364-367

rate limiting, 375-376

spin locks, 186

statistics, 374

UID as a conditional, 373-374

declaring

kobjects, 352-353

linked lists, 88

tasklets, 144-145

decoded version, oops, 369

deferences, 92

defining

atomic operations, 177

linked lists, 89-90

Deitel, Harvey, 407-408

Deitel, Paul, 407

del_timer_sync() function, 223

delays, timers, 226-227

denoting system calls, 73-74

dentries, sysfs, 355

dentry object, VFS (Virtual Filesystem), 265, 275-276

caches, 276-277

operations, 278-279

states, 276

dequeuing data, 98

design, slab layers, 246-252

Design and Implementation of the 4.4BSD Operating System, The, 408

Design of OS/2, The, 408

Design of the Unix Operating System, The, 407

dev_t data type, 384

development kernel, 8-10

maintenance, 403

device model

benefits, 348-349

kobjects, 349-350

declaring, 352-353

embedding, 350

managing, 352-353

sysfs filesystem, 355-362

ksets, 351

ktypes, 350-351

name pointer, 349

parent pointer, 350

reference counts, 353-355

incrementing and decrementing, 354

kref structure, 354-355

sd pointer, 350

structures, 351-352

devices, 337

block devices, 289-290

buffer heads, 291

buffers, 291-294

sectors, 290-291

character devices, 289, 337

drivers, 114

glock devices, 337

miscellaneous devices, 338

network devices, 338

Dijkstra, Edsger Wybe, 192

directories, 264

directory object, VFS (Virtual Filesystem), 265

dirty lists, 324

dirty page writeback, 331

disable irq nosync() function, 129

disable irq() function, 129-130

disable_irq() function, 130

disable_irq_nosync() function, 130

disabling

bottom halves, 157-159

interrupts, 127-129

kernel preemption, 201-202

do mmap() function, 318-319

do softirq() function, 138-141

do timer() function, 218

documentation

coding style, 396

self-generating documentation, 401

Documentation directory, kernel source tree, 13

doublewords, 382

doubly linked lists, 85-86

down interruptible() function, 193-194

down trylock() function, 193-194

down() function, 194

downgrade write() function, 195

do_exit() function, 36

do_IRQ() function, 123-125

do_munmap() function, 320

do_timer() function, 218

drivers, 114

RTC (real-time clock) driver, 120-122

drivers directory, kernel source tree, 13

dump information, debugging, 370-371

dump_stack() function, 371

dynamic timers, 207, 222

E

early printk() function, 365

elements, 85

elevators, I/O schedulers, 299-300

embedding kobjects, 350

enable_irq() function, 130

enabling interrupts, 127-128

enqueuing data, 98

entity structure, process scheduler, 50

entry points, scheduler, 57-58

epoch, 220

Ethernet devices. See network devices

events, relationship with time, 207

eviction (cache), 324-325

exceptions, 114

exec() function, 31

executable files, 29

execution, softirqs, 138-140

exokernel, 7

Expert C Programming, 409

explicitly sized data types, 385-386

exported symbols, modules, 348

F

fair scheduling, 48-50

family tree, processes, 29-30

fields, memory descriptor, 307-308

file attributes, kobjects, 358-359

conventions, 360-361

creating, 359-360

destroying, 360

file metadata, 264

file object, VFS (Virtual Filesystem), 265, 279-280

operations, 280-284

file-backed mapping, 318

files, 263

header files, 17

kobjects, adding to, 358-361

metadata, 264

filesystem

abstraction layer, 262-263

interface, 261-262

UNIX filesystems, 264

filesystem blocks, 290

filesystem files, page caching, 326

filesystem interface, 261

filesystems, 263, 264. See also VFS (Virtual Filesystem)

data structures, 285-288

Linux, support, 288

metadata, 264

UNIX filesystems, 263

VFS (Virtual Filesystem)

data structures, 265-266

objects, 265-266

files_struct data structure, 287

find_get_page() method, 329

find_vma() function, 316-317

find_vma prev() function, 317

find_vma_intersection() function, 317

firmware directory, kernel source code, 13

fixed-size stacks, 20

flags

clone() function, 34-35

interrupt handlers, 116-117

map type flags, 319

page protection flags, 319

VMAs (virtual memory areas), 311-312

flat address spaces, 305

floating point instructions, 20

flush scheduled work() function, 154

flusher threads, 331-335

flushing work queues, 154

fork() function, 24, 31-34

forking, 32

free lists, 245

free percpu() function, 258

free_irq() function, 118

freeing

data structures, slab layers, 245-252

interrupt handlers, 118

freeing pages, 237

frequencies, timer interrupts, 209

front/back merging, I/O scheduler, 299-300

fs directory, kernel source tree, 13

fs_struct data structure, 287

ftime() library call, 221

functions

account_process_tick(), 219

cli(), 128

clone(), 34-35

coding style, 400

context_switch(), 62

copy_process(), 32

disable_irq(), 129-130

disable_irq_nosync(), 130

do_exit(), 36

do_IRQ(), 123-125

do_mmap(), 318-320

do_munmap(), 320

do_softirq(), 138

enable_irq(), 130

exec(), 31

find_vma prev(), 317

find_vma(), 316-317

find_vma_intersection(), 317

fork(), 31-32, 34

free_irq(), 118

hello_init(), 339

idr_destroy(), 103

inline functions, 18-19, 400

in_interrupt(), 130

in_irq(), 130

irqs_disabled(), 130

kfree() function, 243-244

kmalloc(), 238-244

gfp_mask flags, 238-243

kthread_create(), 36

likely(), 20

list_add(), 91

list_del(), 91

list_for_each(), 93

list_for_each_entry(), 96

list_move(), 92

list_splice(), 92

local_bh_disable(), 157

local_irq_disable(), 130

local_irq_enable(), 130

local_irq_restore(), 130

local_irq_save(), 130

malloc(), 238

mmap(), 319-320

munmap(), 320

nice(), 66

open(), 5

panic(), 371

printf(), 5, 17, 364-367

printk(), 17, 364-367, 375

raise_softirq(), 141

read(), 326

relationship with time, 207

request_irq(), 118

schedule_timeout(), 227-230

strcpy(), 5

tasklet_disable(), 145

tasklet_disable_nosync(), 145

tasklet_enable(), 146

tasklet_kill(), 146

tick_periodic(), 219

unlikely(), 20

update_curr(), 51-52

vfork(), 33-34

vmalloc(), 244-245

void local_bh_disable(), 158

void local_bh_enable(), 158

wait(), 24

wake_up_process(), 36

write(), 5

G

Gagne, Greg, 407

Galvin, Peter Baer, 407

gcc (GNU Compiler Collection), 18

gdb, 373

generating patches, 404-405

get bh() function, 293

get cpu() function, 202

get sb() function, 285

get_cpu_var() function, 258

get_free_page() function, 236

get_zeroed_page() function, 237

gettimeofday() function, 221

gettimeofday() system call, 221

gfp_mask flags, kmalloc() function, 238-243

gid_t data type, 384

git source management tool, 11-12

binary searching, 376-377

generating patches, 405

global hash, page caches, 330

global variables, jiffies, 212-216

GNU C, 18

branch annotation, 19-20

inline assembly, 19

inline functions, 18-19

GNU debugger, 372-373

GNU General Public License (GPL), 4

Goüdel, Escher, Bach, 409

granularity, locking, 171

H

hackers, 403

HAL (hardware abstraction layer), 357

halves

division of work, 134

interrupt handlers, 115-116

handlers, system calls, 73-74

hard real-time scheduling policies, 64

hard sectors. See sectors

hardware, applications, relationship, 6

header files, 17

heads, 290

Hello, World! module, 338-340

hello_init() function, 339

HI_SOFTIRQ tasklet, 140

high memory, 393

high memory mappings, 253-255

hitting, timers, 208

Hofstadter, Douglas, 409

HP-UX (Hewlett Packard), 2

HP-UX 11i Internals, 408

HRTIMER_SOFTIRQ tasklet, 140

Hungarian notation, 400

Hz values, 208-212

jiffies global variable, 216

I

I/O block layer, request queues, 297

I/O blocks, 290

I/O schedulers, 297-298

Anticipatory I/O scheduler, 302-303

CFQ (Complete Fair Queuing) I/O scheduler, 303

Deadline I/O scheduler, 300-302

front/back merging, 299-300

Linus Elevator, 299-300

merging/sorting functions, 298-299

minimized read latency, 302-303

Noop I/O scheduler, 303-304

request starvation prevention, 300-302

selection options, 304

I/O-bound processes, versus processor-bound processes, 43-44

idle process, operating systems, 6

idr_destroy() function, 103

IEEE (Institute of Electrical and Electronics Engineers), 70

ifdef preprocessor directives, coding style, 402

implementation

interrupt handlers, 123-126

softirqs, 137-140

system calls, 74-78

tasklets, 142-144

timers, 224

work queues, 149-153

implementing system calls, 82-83

in interrupt() function, 130

in-kernel debugger, 372-373

in_interrupt() function, 130

in_irq() function, 130

include directory, kernel source tree, 13

incremental patches, 12

increments, atomic operations, 175-176

indent utility, 403

indention, coding style, 396

indexes, softirqs, 140-141

init completion() function, 198

init directory, kernel source tree, 13

initialization, semaphores, 192

inline functions, 400

GNU C, 18-19

inode, 264

inode object, VFS (Virtual Filesystem), 265, 270-274

inodes, page caches, 331

installation

kernel, 16

modules, 342

source code, 12

integer atomic operations, 176-179

64-bit atomic operations, 180-181

interfaces

atomic operations, 176

filesystem, 261-262

slab layers, 249-252

wrapping, 402

internal representation, jiffies global variable, 213-214

internal values, timers, 222

interprocess communication (IPC) mechanism, 7

interrupt context, 5

kernels, 122

stack space, 122-123

interrupt handlers, 5, 113

bottom halves, 115-116, 133-135

benefits, 134-135

BH interface, 135-136

softirqs, 136-141

task queues, 135

tasklets, 136

controlling interrupts, 127-130

do_IRQ() function, 123-125

flags, 116-117

freeing, 118

free_irq() function, 118

function of, 114-115

implementing, 123-126

interrupt-safe code, 168

limitations, 133

locks, 185-186

reentrancy, 119

registering, 116

request_irq() function, 118

RTC (real-time clock) driver, 120-122

shared, 119-120

speed of, 122

timer, 217-220

top half, 115

top halves, 133

when to use, 135

writing, 118-119

interrupt request (IRQ), 114

interrupt service routine (ISR). See interrupt handlers

interrupt stacks, 122

interrupt-safe code, 168

interrupts, 5, 113-114, 117, 131

asynchronous, 114

concurrency, 167

context, 115

controlling, 127-130

disable irq nosync() function, 130

disabling, 127-129

enable irq() function, 130

enabling, 127-128

in interrupt() function, 130

in irq() function, 130

irqs disabled() function, 130

local irq disable() function, 130

local irq enable() function, 130

local irq save() function, 130

synchronous, 114

timers, frequencies, 209

ioctl() method, 284

IPC (interprocess communication) mechanism, 7

ipc directory, kernel source tree, 13

IRIX (SGI), 2

IRQ (interrupt request), 114

irqs_disabled() function, 130

ISR (interrupt service routine), 114

iterating linked lists, 94-95

J

jiffies, 391

origins of term, 212-213

sequential locks, 200

jiffies global variable, 212-213

HZ values, 216

internal representation, 213-214

wraparounds, 214-216

K

kallsyms, 369-370

Karels, Michael J., 408

kbuild build system, building modules, 340-342

KERN ALERT loglevel, printk() function, 366

KERN CRIT loglevel, printk() function, 366

KERN DEBUG loglevel, printk() function, 366

KERN EMERG loglevel, printk() function, 366

KERN ERR loglevel, printk() function, 366

KERN INFO loglevel, printk() function, 366

KERN NOTICE loglevel, printk() function, 366

KERN WARNING loglevel, printk() function, 366

kernel

applications, relationship, 6

building, 13-16

C library, 17

concurrency, 21

configuring, 14-15

debugging help resources, 377

defined, 4

development kernel, 8-10

downloading, 11

fixed-size stack, 20

floating point instructions, 20

hardware, 5

relationship, 6

implementing, linked lists, 88-90

installing, 16

interrupt context, 5

interrupt handlers, 5

lack of memory protection, 20

modules, 7

monolithic, 7

naming conventions, 9

portability, 21

preemption, concurrency, 167

producer and consumer pattern, 96

root directories, 12-13

rules, 16-21

small, fixed-size, 21

source tree, 12-13

stable kernel, 8-9, 11

structure, 88

synchronization, 21

system calls, 71

vendor kernels, 14

kernel directory, kernel source tree, 13

Kernel Event Layer

D-BUS, 361

kobjects, 361-362

netlink, 361

parameters, 362

payloads, 361

verb strings, 361

kernel locked() function, 199

kernel maintainer, 403

kernel messages

klogd daemon, 367

log buffer, 366-367

oops, 367-370

syslogd daemon, 367

Kernel Newbies website, 395

kernel objects, 337

kernel preemption, 7, 393

per-CPU data, 256

process scheduler, 63-64

kernel random number generator, 338

kernel threads, 35-36

memory descriptor, 309

pdflush task, 35

kernel timers. See timers

Kernel Traffic website, 395

kernel-space, 29

Kernel.org, 409

Kernighan, Brian, 399, 409

kfifo queues, 97-100

creating, 97-98

dequeuing data, 98

destroying, 99

enqueuing data, 98

obtaining size of, 98

resetting, 99

kfree() function, 243-244

kgdb, 373

klogd daemon, kernel messages, 367

kmalloc() function, 238-244, 259

gfp_mask flags, 238-243

Knuth, Donald, 409

kobjects

device model, 349-350

managing, 352-353

file attributes, 358-359

conventions, 360-361

creating, 359-360

destroying, 360

sysfs filesystem, 355

adding and removing from, 357-358

adding files, 358-361

dentries, 355

Kernel Event Layer, 361-362

root directories, 357

kobject_create() function, 353

Kogan, Michael, 408

kqdb debugger, 373

kref structure, device model reference counts, 354-355

kref_put() function, 354

Kroah-Hartman, Greg, 408

ksets, device model, 351

ksoftirqd task, 35

ksoftirqd threads, tasklets, 146-147

kthreadd kernel process, 36

kthread_create() function, 36

ktypes, device model, 350-351

kupdated kernel thread, 333-334

kysmoops, 369

L

laptop mode, page writeback, 333

last-in/first-out (LIFO) ordering, 94

least recently used (LRU), cache eviction, 325

lib directory, kernel source tree, 13

libc functions, 17

lifecycle, processes, 24

lightweight processes, threads, 34

likely() function, 20

limitations, interrupt handlers, 133

line length, coding style, 399-400

linked lists, 85

circular linked lists, 86-87

declaring, 88

defining, 89-90

doubly linked lists, 85-86

iterating through backward, 94

iterating while removing, 95

kernel implementation, 88-90

manipulating, 90-92

memory, 313

navigating through, 87-88

nodes

adding to, 90-91

deleting from, 91-92

moving, 92

splicing, 92

singly linked lists, 85-86

traversing, 93-96

Linus Elevator, I/O schedulers, 299-300

Linux, 1

development history, 3

dynamic loading, 8

filesystems, support, 288

kernel development community, 10

object-oriented device model, 8

open source status, 4

portability, 380-381

preemptive nature, 8

scalability, 171

symmetrical multiprocessor (SMP), 8

thread implementation, 33-36

thread support, 8

Unix, 3

versus Unix kernel, 6, 8

Linux Device Drivers, 408

Linux kernel community, 395

Linux Kernel Mailing List (lkml), 10, 395

Linux System Programming, 409

Linux Weekly News, 395, 409

list for each() function, 93

list move() function, 92

list splice() function, 92

lists, VMAs (virtual memory areas), 313-314

list_add() function, 91

list_del() function, 91

list_for_each_entry() function, 96

little-endian byte ordering, 389-391

lkml (Linux Kernel Mailing List), 10, 395

loading

modules, 343-344

managing configuration options, 344-346

local bh disable() function, 157

local bh enable() function, 157-158

local_irq_disable() function, 130

local_irq_enable() function, 130

local_irq_restore() function, 130

local_irq_save() function, 130

lock contention, 171

lock kernel() function, 199

locking

coarse locking, 172

granularity, 171

need of protection, 168-169

race conditions, 165-166

locking between bottom halves, 157

locks, 165

acquiring, 193

advisory, 166

BKL (Big Kernel Lock), 198-199

busying wait, 166

contention, 171

deadlocks, threads, 169-171

debugging, 186

functions, 193

mutexes, 195-197

non-recursive nature, 185

releasing, 193

semaphores, 190-191

binary semaphores, 191-192

counting semaphores, 191-192

creating, 192-193

implementing, 193-194

initializing, 192

reader-writer semaphores, 194-195

sequential locks, 200-201

spin locks, 183-187

bottom halves, 187-188

debugging, 186

methods, 184-187

reader-writer spin locks, 188-190

use in interrupt handlers, 185-186

versus code, 186

voluntary, 166

log buffers, kernel messages, 366-367

loglevels, printk() function, 365-366

looking up UIDs (unique identification numbers), 102-103

Love, Robert, 409

LRU (least recently used), cache eviction, 325

M

Mac OS X Internals: A Systems Approach, 408

Magic SysRq key commands, 371-372

maintainers, 403

malloc() function, 238, 306

map type flags, 319

mapping, 100

anonymous mapping, 318

file-backed mapping, 318

VMAs (virtual memory areas), 312

mappings (high memory), 253

permanent mappings, 254

temporary mappings, 254-255

maps, UIDs (unique identification numbers), 100

allocating, 101-102

looking up, 102

removing, 103

Mauro, Jim, 408

mb() function, 204-205

McCreight, Edward M., 327

McDougall, Richard, 408

McKusick, Marshall Kirk, 408

mdelay() function, 227

memory

allocation, 231, 260

choosing method, 259

high memory mappings, 253-255

kfree() function, 243-244

kmalloc() function, 238-244

pages, 231-232, 235-237

per-CPU allocations, 255-258

slab layers, 245-252

statically allocating on stack, 252-253

vmalloc() function, 244-245

zones, 233-235

high memory, 393

linked list, 313

memory areas, 305-306

memory descriptor, 306

mmap field, 313

MMUs (memory management units), 231

objects, pinned, 353

pages, 231-233

freeing, 237

obtaining, 235-244

zeroed pages, 236-237

zones, 233-235

process address space, 305

red-black tree, 313

VMAs (virtual memory areas), 309-310, 314-315

flags, 311-312

lists, 313-314

locating, 316-317

operations, 312-313

private mapping, 312

shared mapping, 312

trees, 313-314

memory areas, 314-315. See also VMAs (virtual memory areas)

lists, 313-314

manipulating, 315-318

trees, 313-314

memory descriptor, 306

allocating, 308

destroying, 309

fields, 307-308

kernel threads, 309

mm struct, 309

memory maps, 306

memory-management unit (MMU), 6

memory protection, kernel, lack of, 20

memory reads/writes, 203-206

memset() function, 353

merging functions, I/O scheduler, 298-299

message passing, 7

metadata files, 264

methods

context_switch(), 380

ioctl(), 284

readpage(), 328

spin locks, 184-187

switch_mm(), 380

switch_to(), 380

synchronization methods, 175

64-bit atomic operations, 180-181

atomic operations, 175-179

barriers, 203-206

bitwise atomic operations, 181-183

BKL (Big Kernel Lock), 198-199

completion variables, 197-198

mutexes, 195-197

nonatomic bit operations, 183

ordering, 203-206

preemption disabling, 201-202

semaphores, 190-195

sequential locks, 200-201

spin locks, 183-190

writepage(), 328

microkernel designs, monolithic designs, compared, 7

microkernels, message passing, 7

migration threads, 66

miscellaneous devices, 338

mm directory, kernel source tree, 13

mm struct, memory descriptor, 309

mmap() function, 306, 319

MMUs (memory management units), 6, 231

mod timer() function, 223

Modern Operating Systems, 407

modprobe command, 343

modules, 14, 337-338

building, 340-342

configuration options, managing, 344-346

dependencies, generating, 342

exported symbols, 348

Hello, World!, 338-340

installing, 342

kernel, 7

living externally of kernel source tree, 342

loading, 343-344

parameters, 346-347

removing, 343

source trees, 340-342

MODULE_AUTHOR() macro, 340

MODULE_DESCRIPTION() macro, 340

module_exit() function, 339

module_init() macro, 339

MODULE_LICENSE() macro, 340

monolithic kernel, microkernel designs, compared, 7

Moore, Chris, 408

Morton, Andrew, 9

mount flags, 286

mount points, 263

multiplexing system calls, 74

multiprocessing, symmetrical multiprocessing, 161

concurrency, 167

multitasking, 41-42

munmap() function, 320

mutexes, 191, 195-197

N

name pointer, device model, 349

namespace data structure, 287-288

namespaces, 263

naming conventions

coding style, 400

kernel, 9

net directory, kernel source tree, 13

NET_RX_SOFTIRQ tasklet, 140

NET_TX_SOFTIRQ tasklet, 140

netlink, Kernel Event Layer, 361

network devices, 338

Neville-Neil, George V., 408

nice values, processes, 44

nice() function, 66

nodes, 85

linked lists

adding to, 90-91

deleting from, 91-92

moving, 92

splicing, 92

nonatomic bit operations, 183

Noop I/O scheduler, 303-304

notation, Hungarian notation, 400

numbers, system calls, 72

O

O(1) scheduler, 42-43

object-oriented device model, Linux, 8

objects

pinned, 353

VFS (Virtual Filesystem), 265-266

dentry, 265, 275-279

directory, 265

file, 265, 279-284

inode, 265, 270-274

operations, 265

superblock, 265-269

occurrence limiting, debugging, 375-376

oops, kernel messages, 367-370

opaque data types, 384

operations, VMAs (virtual memory areas), 312-313

open softirq() function, 141

open() function, 5

open() system call, 261

Operating System Concepts, 407

operating systems, 4

general activities, 5

idle process, 6

kernel-space, 5

multitasking, 41

portability, 379-380

scalability, 171

supervisor, 4

system calls, 5

tickless operations, 212

Operating Systems, 407

Operating Systems: Design and Implementation, 407

operations object, VFS (Virtual Filesystem), 265

order preservation, 100

ordering

atomicity, compared, 179

barrier operations, 179

memory reads/writes, 203-206

OS News. com, 409

P

PAE (Physical Address Extension), 253

page caches, 323-326

address_space object, 326-328

address_space operations, 328-330

buffer caches, 330-331

filesystem files, 326

flusher threads, 331-335

global hash, 330

radix tree, 330

readpage() method, 328

writepage() method, 328

page_count() function, 232

page global directory (PGD), 321

page middle directory (PMD), 321

page protection flags, 319

page size, architectures, 391-392

page tables, 320-322

future management possibilities, 322

levels, 320-321

page writeback, 323

bdflush kernel thread, 333-334

dirty page writeback, 331

kupdated kernel thread, 333-334

laptop mode, 333

pdflush kernel thread, 333-334

settings, 332

pageable kernel memory, 8

pages (memory), 231-233

freeing, 237

obtaining, 235-236

kfree() function, 243-244

kmalloc() function, 238-244

vmalloc() function, 244-245

zeroed pages, 236-237

word size, 381

zones, 233-235

panic() function, 371

parallelism, threads, 33

parameter passing, system calls, 74

parameters

Kernel Event Layer, 362

modules, 346-347

system calls, verifying, 75-78

parent pointer, device model, 350

parentless tasks, 38-40

patches

generating, 404-405

incremental, 12

submitting, 406

payloads, Kernel Event Layer, 361

pdflush kernel thread, 333-334

pdflush task, 35

per-CPU allocations, 255-256

percpu interface, 256-258

per-CPU data

benefits, 258-259

thrashing the cache, 258

percpu interface, 256-258

at compile-time, 256-257

at runtime, 257-258

performance, system calls, 72

permanent high memory mappings, 254

PGD (page global directory), 321

PID (process identification), 26

pid_t data type, 384

pinned objects, 353

PIT (programmable interrupt timer), 217

PMD (page middle directory), 321

Pointers, dereferences, 92

policy (scheduler), 43-46

I/O-bound processes, 43-44

priority-based scheduling, 44

processor-bound processes, 43-44

timeslices, 45

poll() system call, 211

polling, 113

popping, timers, 208

portability, 21, 379

byte ordering, 389-391

data alignment, 386-389

data types, 384

high memory, 393

implications of, 393

kernel preemption, 393

Linux, 380-381

operating systems, 379-380

page size architecture, 391

processor ordering, 392

scheduler, 380

SMP (symmetrical multiprocessing), 393

time, 391

word size, 381-384

POSIX, system calls, 70

preempt count() function, 202

preempt disable() function, 202

preempt enable no resched() function, 202

preempt enable() function, 202

preemption

kernel, concurrency, 167

process scheduler, 62

kernel preemption, 63-64

user preemption, 62-63

preemption disabling, 201-202

preemptive multitasking, process scheduler, 41

printf() function, 5, 17, 364

loglevels, 365-366

transposing, 367

printing, debugging, 364-367

printk() function, 17, 375

debugging, 364-366

loglevels, 365-366

nonrobustness of, 365

robustness of, 365

transposing, 367

priority-based scheduling, 44

private mapping, VMAs (virtual memory areas), 312

/proc/interrupts file, 126-127

process address space

address intervals

creating, 318-319

removing, 320

flat versus segmented, 305

memory areas, manipulating, 315-318

memory descriptors, 306-308

allocating, 308

destroying, 309

kernel threads, 309

mm struct, 309

overview, 305

page tables, 320-322

VMAs (virtual memory areas), 309-310, 314-315

flags, 311-312

lists, 313-314

operations, 312-313

trees, 313-314

process descriptors

allocating, 25-26

states, 27-29

storing, 26-27

task list, 24

TASK_INTERRUPTIBLE process, 27

TASK_RUNNING process, 27

TASK_STOPPED process, 28

TASK_UNINTERRUPTIBLE process, 28

process descriptors (task list), 24-25

process scheduler, 41

algorithm, 46-50

classes, 46-47

Completely Fair Scheduler scheduler, 43

context switching, 62

cooperative multitasking, 41-42

entity structure, 50

entry point, 57-58

evolution, 42-43

fair scheduling, 48-50

implementing, 50-59, 61

O(1) scheduler, 42-43

policy, 43-46

I/O-bound processes, 43-44

priority-based scheduling, 44

processor-bound processes, 43-44

timeslices, 45

preemption, 62-64

preemptive multitasking, 41

process selection, 52-57

real-time scheduling policies, 64-65

Rotating Staircase Deadline scheduler, 43

system calls, 65-67

time accounting, 50-52

timeslices, 42

Unix systems, 47-48

virtual runtime, 51-52

yielding, 42

process states, 27-29

processes

adding to trees, 54-55

address space, 23

context, 29

creating, 31

data structures, 286-288

defined, 23

I/O-bound processes, 43-44

lifecycle of, 24

nice values, 44

real-time, 44

real-time processes, 44

removing from trees, 56-57

resources, 23-24

runnable processes, 41

scalability, 171

task list, 24

tasks, 24

terminating, 24, 36-40

threads, 305

timeslice count, 211

virtual memory, 23

virtual processor, 23

processor affinity system calls, 66

processor ordering, 392

processor time, yielding, 66

processor-bound processors versus I/O-bound processes, 43-44

procfs virtual filesystem, 126-127

producer and consumer programming pattern, kernel, 96

programs, processes, 24

pseudo-concurrency processes, 167

put bh() function, 293

put_cpu_var() function, 258

Q

quantum slice. See timeslices

Quarterman, John S., 408

queues, 96-97

creating, 97-98

dequeuing data, 98

destroying, 99

enqueuing data, 98

kfifo, 97-100

obtaining size of, 98

resetting, 99

R

race conditions

ATM processing example, 163

locking, 165-166

multiple threads of execution, 162

timers, 224

radix trees, page caches, 330

Rago, Stephen, 409

raise softirq irqoff() function, 141

raise softirq() function, 141

rate limiting, debugging, 375-376

rbtrees, 106-108

RCU_SOFTIRQ tasklet, 140

read barrier depends() function, 204-205

read lock irq() function, 189

read lock irqsave() function, 189

read lock() function, 189

read seqbegin() function, 220

read seqretry() function, 220

read unlock irq() function, 189

read unlock irqrestore() function, 189

read unlock() function, 189

read() function, 326

read() system call, 261

reader-writer semaphores, 194-195

reader-writer spin locks, 188-190

readpage() method, 328

read_barrier_depends() function, 205

real-time clock (RTC) driver, 120-122, 217

real-time priority, 44

real-time scheduling policies, 64-65

red-black binary trees, 105-106

red-black trees, memory, 313

reentrancy, interrupt handlers, 119

reference counts, device model, 353-355

registration, interrupt handlers, 116

relative time, 207

reparenting child tasks, 38

REPORTING-BUGS file, 404

request queues, I/O block layer, 297

request_irq() function, 118

Ritchie, Dennis, 1-3, 399, 409

rmb() function, 204-205

root directories, sysfs file system, 357

Rotating Staircase Deadline scheduler, 43

routines, coding style, 402

RTC (real-time clock) driver, 120-122, 217

Rubini, Alessandro, 408

rules, kernel, 16-21

run local timers() function, 219

run_local_timers() function, 224

run_timer_softirq() function, 224

runnable processes, 41

Russinovich, Mark, 408

rw lock init() function, 190

S

samples directory, kernel source code, 13

scalability, 171

algorithms, 109

sched_getaffinity() system call, 66

sched_getparam() system call, 66

sched_getscheduler() system call, 66

sched_get_priority_max() system call, 66

sched_get_priority_min() system call, 66

sched_setaffinity() system call, 66

sched_setparam() system call, 66

sched_setscheduler() system call, 66

SCHED_SOFTIRQ tasklet, 140

sched_yield() system call, 66-67

schedule delayed work() function, 154-155

scheduler, 41

algorithm, 46-50

classes, 46-47

Completely Fair Scheduler scheduler, 43

context switching, 62

cooperative multitasking, 41-42

entity structure, 50

entry point, 57-58

evolution, 42-43

fair scheduling, 48-50

implementing, 50-61

O(1) scheduler, 42-43

policy, 43-46

I/O-bound processes, 43-44

priority-based scheduling, 44

processor-bound processes, 43-44

timeslices, 45

preemption, 62

kernel preemption, 63-64

user preemption, 62-63

preemptive multitasking, 41

process selection, 52-57

real-time scheduling policies, 64-65

Rotating Staircase Deadline scheduler, 43

system calls, 65-67

time accounting, 50-52

timeslices, 42

Unix systems, 47-48

virtual runtime, 51-52

yielding, 42

schedule_timeout() function, 227-230

scheduler_tick() function, 218-219

scheduling

tasklets, 143-146

work queues, 153-154

Schimmel, Curt, 408

scripts directory, kernel source tree, 13

sd pointer, device model, 350

sectors, block devices, 290-291

security directory, kernel source tree, 13

segmented address spaces, 305

segments, block I/O layer, 294-295

select() system call, 211

self-balanced binary search trees, 105

rbtrees, 106-108

red-black trees, 105-106

self-generating documentation, 401

sema init() function, 193

semaphores, 190-191

binary semaphores, 191-192

counting semaphores, 191-192

creating, 192-193

implementing, 193-194

initializing, 192

mutexes, compared, 197

reader-writer semaphores, 194-195

upping, 192

seqlocks, 220

Sequent DYNIX/ptx, 2

sequential locks, 200-201

settimeofday() system call, 221

settings, page writeback, 332

shared interrupt handlers, 119-120

shared mapping, VMAs (virtual memory areas), 312

SIAM Journal of Computing, 327

side effects, system calls, 71

Silberschatz, Abraham, 407

Singh, Amit, 408

single-page kernel stacks, statically allocating memory, 252-253

singly linked lists, 85-86

slab allocator, 25

“Slab Allocator: An Object-Caching Kernel Memory Allocator,” 246

slab layers

design of, 246

inode data structure example, 247-249

interface, 249-252

memory allocation, 245-252

tenets of, 246

sleep, wait queues, 229

sleeping concurrency, 167

sleeping locks, 192

behaviors, 191

mutexes, 195-197

versus semaphores, 197

versus spin locks, 197

semaphores, 190-191

binary semaphores, 191-192

counting semaphores, 191-192

creating, 192-193

implementing, 193-194

initializing, 192

reader-writer semaphores, 194-195

versus spin locks, 191

SMP (symmetrical multiprocessing), 8

portability, 393

smp mb() function, 205-206

smp read barrier depends() function, 205

smp rmb() function, 205-206

smp wmb() function, 205-206

smp_read_barrier_depends() function, 206

soft real-time scheduling policies, 64

softirqs

assigning indexes, 140-141

bottom half mechanism, 137-138

bottom half mechanism, executing, 140

bottom half mechanism, index assignments, 140

bottom halves, 136-141, 188

concurrency, 167

executing, 138-140

handler, 138

handlers, registering, 141

implementing, 137-140

ksoftirqd threads, 146-147

raising, 141

types, 140

Solaris (Sun), 2

Solaris Internals: Solaris and OpenSolaris Kernel Architecture, 408

Solomon, David, 408

sorting functions, I/O scheduler, 298-299

sound directory, kernel source tree, 13

source code, 11-12

source trees, 12-13

modules, 340-342

spacing coding style, 397-398

special data types, 384-385

spin is locked() method, 187

spin lock init() method, 186

spin lock irq() function, 186

spin lock irqsave() method, 187

spin locks, 183-186

bottom halves, 187-188

debugging, 186

methods, 184-187

mutexes, compared, 197

reader-writer spin locks, 188-190

spin try lock() method, 186

spin unlock() method, 187

spin_is_locked() method, 187

spin_lock() method, 187

spin_lock_init() method, 187

spin_lock_irq() method, 186

spin_lock_irqsave() method, 185

spin_trylock() method, 187

spin_unlock_irq() method, 187

spin_unlock_irqrestore() method, 185-187

spins, 184

stable kernel, 8-10

maintenance, 403

stacks

interrupt context, 122-123

interrupt stacks, 122

statically allocating memory on, 252-253

statements, switch statements, coding style, 396-397

statically allocating memory on stack, 252-253

statistics, debugging, 374

Stevens, W. Richard, 409

storing process descriptors, 26-27

structure padding, data alignment, 387-389

strcpy() function, 5

STREAMS, 8

structure initializers, coding style, 402-403

submitting

bug reports, 403-404

patches, 406

subscribing to Linux Kernel Mailing List (LKML), 395

superblock data structure, 264

superblock object, VFS (Virtual Filesystem), 265-269

Swift, Jonathan, 390

switch statements, coding style, 396-397

switch_mm() method, 380

switch_to() method, 380

symmetrical multiprocessing

concurrency, 167

introduction of, 161-162

symmetrical multiprocessor (SMP), 8

synchronization, 162-168, 172

kernel, 21

reasons, 162-163

synchronization methods, 175

atomic operations, 175

64-bit operations, 180-181

bitwise operations, 181-183

converting, 177

counter implementation, 177

defining, 177

increments, 175-176

integer operations, 176-179

interfaces, 176

nonatomic bit operations, 183

overhead advantages, 179

testing, 177

barriers, 203-206

BKL (Big Kernel Lock), 198-199

completion variables, 197-198

mutexes, 195-197

ordering, 203-206

preemption disabling, 201-202

semaphores, 190-191

binary semaphores, 191-192

counting semaphores, 191-192

creating, 192-193

implementing, 193-194

initializing, 192

reader-writer semaphores, 194-195

sequential locks, 200-201

spin locks, 183-186

bottom halves, 187-188

reader-writer spin locks, 188-190

synchronous interrupts, 114

syscalls. See system calls

sysfs, 337

sysfs filesystem, 355

adding and removing kobjects, 357-358

adding files, 358-361

dentries, 355

Kernel Event Layer, 361-362

root directories, 357

syslogd daemon, kernel messages, 367

SysRq commands, 371

system call() function, 73

system calls, 5, 69

accessing, 71

accessing from user-space, 81-82

alternatives, 82-83

API (Application Programming Interface), 70

arguments, 71

behaviors, 71-72

binding, 79-81

C library, 70-71

clone(), 32

context, 78-81

denoting correct calls, 73

handlers, 73-74

implementation, 74-78

kernel, 71

multiplexing, 74

numbers, 72

parameter passing, 74

performance, 72

POSIX, 70

process scheduler, 65-67

processor affinity, 66

processor time, yielding, 66

pros and cons, 82

purpose of, 69

return values, 71

scheduler, 65-66

sched_getaffinity(), 66

sched_getscheduler(), 66

sched_get_priority_max(), 66

sched_setaffinity(), 66

sched_setparam(), 66

sched_setscheduler(), 66

sched_yield(), 67

side effects, 71

verifying, 75-78

system timers, 207-208, 217

system uptime, 207-208

T

Tanenbaum, Andrew, 407

tarball

installing, 12

source code, 11

task lists, 24-25

task queues, bottom halves, 135

TASK_INTERRUPTIBLE process, 27

TASK_RUNNING process, 27

TASK_STOPPED process, 28

task_struct, 24

TASK_TRACED process, 28

TASK_UNINTERRUPTIBLE process, 28

tasklet action() function, 143

tasklet disable() function, 145

tasklet disable nosync() function, 145

tasklet enable() function, 146

tasklet handlers, writing, 145

tasklet hi action() function, 143

tasklet hi schedule() function, 143

tasklet kill() function, 146

tasklet schedule() function, 143

tasklets, 137

BH interface, 148

bottom half mechanism, 142-143

bottom halves, 136

concurrency, 167

declaring, 144-145

implementing, 142-144

ksoftirqd threads, 146-147

scheduling, 143-146

softirq types, 140

structure, 142

TASKLET_SOFTIRQ tasklet, 140

tasks, 24

ksoftirqd, 35

parentless tasks, 38-40

pdflush, 35

sleeping, 58-61

waking up, 61

temporal locality, 323

temporary high memory mappings, 254-255

terminating processes, 36-40

testing atomic operations, 177

text section (processes), 23

Thompson, Ken, 1, 3

thrashing the cache per-CPU data, 258

thread support, Linux, 8

thread_info structure, 26

threads, 23, 34, 305

avoiding congestion, 334-335

bdflush, 333-334

concurrent programming, 33

contended, 184

creating, 34

deadlocks, 169-171

flusher threads, 331-335

kernel, 35-36

ksoftirqd, 146-147

kupdated, 333-334

lightweight processes, 34

Linux implementation, 33-36

migration threads, 66

parellelism, 33

pdflush, 333-334

worker threads, 149

threads of execution, 23

critical regions, 162

defined, 161

race conditions, 162

tick rate, Hz (hertz), 208-212

tick_periodic() function, 217, 219-220

tickless operating system, 212

time

absolute time, 207

current date and time, 220-221

HZ, 391

importance of, 207

kernel’s concept of, 208

releative time, 207

time accounting, process scheduler, 50-52

time complexity, algorithms, 110-111

time stamp counter (TSC), 217

time() system call, 221

timeouts, wait queues, sleeping on, 229

timer interrupt, 207-208

timer interrupt handler, 217-220

TIMER_SOFTIRQ tasklet, 140

timers

busy looping, 225-226

delaying execution, 225-230

deleting, 223

dynamic timers, 207, 222

hitting, 208

implementation, 224-230

internal values, 222

interrupt handler, 217-220

interrupts, frequencies, 209

kernel, 136

modifying, 223

popping, 208

popularity of, 222

purpose of, 222

race conditions, 224

small delays, 226-227

system timer, 217

using, 222-223

timeslice count, processes, 211

timeslices

process scheduler, 42

process scheduler policy, 45

timespec data structure, 220

tools directory, kernel source code, 13

top halves, interrupt handlers, 115, 133

Torvalds, Linus, 3

transposition, printk() function, 367

traversing linked lists, 93-96

trees

adding processes to, 54-55

removing processes from, 56-57

VMAs (virtual memory areas), 313-314

tristates, 14

Tru64 (Digital), 2

true concurrency, 167

try to wake up() function, 61

two-list strategy, cache eviction, 325-326

type flags, 241-242

typedefs, coding style, 401

U

udelay() function, 227

UIDs (unique identification numbers), 100

allocating, 101-102

looking up, 102

removing, 103

uid_t data type, 384

Understanding Linux Network Internals, 408

University of California at Berkeley, BSD (Berkeley Software Distributions), 2

Unix, 1

characteristics, 2-3

creators, 1

development history, 1-2

evolution, 3

filesystems, 263-264

Linux, compared, 6-8

popularity of, 1

Unix Internals: The New Frontiers, 408

Unix systems, scheduling, 47-48

UNIX Systems for Modern Architectures: Symmetric Multiprocessing and Caching, 408

unlikely() function, 20

unlock kernel() function, 199

up() function, 193-194

update_curr() functions, 51-52

update_process_times() function, 218, 224

update_wall_time() function, 218

upping semaphores, 192

user preemption, process scheduler, 62-63

user spaces, jiffies global variable, 216

user-space, 5

accessing system calls, 81-82

usr directory, kernel source tree, 13

utilities, diffstat, 405

V

Vahalia, Uresh, 408

van der Linden, Peter, 409

variables

completion variables, 197-198

condition variables, debugging, 374

global variables, jiffies, 212-216

xtime, 220

vendor kernels, 14

verb string, Kernel Event Layer, 361

vfork() function, 33-34

VFS (Virtual Filesystem), 261

data structures, 265-266, 285-286

processes, 286-288

file system type structure, 266

interface, 261-262

Linux filesystems, 288

objects, 265-266

dentry, 265, 275-279

directory, 265

file, 265, 279-284

inode, 265, 270-274

operations, 265

superblock, 265-269

vfsmount structure, 285-286

virt directory, kernel source code, 13

virtual device drivers, 338

Virtual Filesystem (VFS)

dentry object, 275, 278

file object, 282

inode object, 270-272

superblock object, 267

vfsmount structure, 266

Virtual Filesystem (VFS). See VFS (Virtual Filesystem)

virtual memory, VMAs (virtual memory areas), 309-310, 314-315

flags, 311-312

lists, 313-314

operations, 312-313

private mapping, 312

shared mapping, 312

trees, 313-314

virtual runtime, processes, 51-52

virtual-to-physical address lookup, 321

vmalloc() function, 244-245, 259

VMAs (virtual memory areas), 309-310, 314-315

flags, 311-312

lists, 313-314

locating, 316-317

operations, 312-313

private mapping, 312

shared mapping, 312

trees, 313-314

void local bh disable() function, 158

void local bh enable() function, 158

voluntary locks, 166

VSF

abstraction layer, 262-263

UNIX filesystems, 263-264

W-X-Y

wait for completion() function, 198

wait queues, 58-59

sleeping on, 229

wait() function, 24

wake up() function, 61

wake_up_process() function, 36

websites, Linux Kernel Mailing List (LKML), 395

Windows Internals: Covering Windows Server 2008 and Windows Vista, 408

wmb() function, 204-205

word size, 381-384

characters, 381

doublewords, 382

pages, 381

usage rules, 383

work queue handler, 153

work queues, 137, 151

bottom half mechanism, 149, 153

old task queues, 155-156

queue creation, 154-155

relationships among data structures, 152-153

run_workqueue() function, 151-152

thread data structure, 149

thread data structures, 150-151

work creation, 153

work flushing, 154

work scheduling, 153

creating, 154-155

implementing, 149-153

scheduling, 153-154

worker thread() function, 151

worker threads, 149

wraparounds, jiffies global variables, 214-216

wrapping interfaces, 402

write caching, 324

write lock irq() function, 189

write lock irqsave() function, 189

write lock() function, 189

write trylock() function, 190

write unlock irq() function, 189

write unlock irqrestore() function, 190

write unlock() function, 189

write() function, 5

write() system call, 261

write-through caches, 324

writepage() method, 328

writes starving reads, 300

writing

interrupt handler, 118-119

tasklet handlers, 145

xtime variable, 220-221

yield() system call, 67

yielding

process scheduler, 42

processor time, 66

Z

zeroed pages, obtaining, 236-237

zone modifiers, gfp_mask flags, 240

zones, 234

pages, 233-235

ZONE_DMA, 233-235

ZONE_DMA32, 233

ZONE_HIGHMEM, 233

ZONE_NORMAL, 233

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.154.86