Solaris Internals

»   Search By Title
»   Search By Author
»   Search By Subject
»   Just Published
»   Soon to be Published
»   Notification Form
»   Listings
 
 
 

Solaris Internals

By Jim Mauro and Richard McDougall
First edition, 700 pages
ISBN 0130224960


buy now ยป


Active Tab Table of Contents

Table of Contents

Foreword

Preface

Part One: Introduction to Solaris Internals

Chapter 1: Introduction to Solaris Internals

Solaris Kernel Essentials
Solaris Kernel Features
The Kernel Directory Hierarchy
Kernel Hardware Control Overview
Device Configuration
Kernel Subsystems and Interfaces
Libraries
Processes and Threads
Memory Management
Files and File Systems
Resource Management and Control
The Solaris 7 64-bit Kernel
The 64-bit Story
The Solaris 7 Directory Name Space
Device Drivers and Kernel Modules
Developing 64-bit Kernel Modules
Compiling Kernel Code
Special Data Types in the Kernel
Kststs
kstat Data Types: Named and Raw
ProcFS
Further Information
Summary

Chapter 2: Kernel Bootstrap and Initialization

Kernel Bootstrap and Initialization
System Kernel Threads
Kernel Module Loading and Linking

Chapter 3: Kernel Facilities

Kernel Processor Control
Cross-Calls
Kernel Traps and Exceptions
The UltraSPARC Trap Handler
The Intel Trap (Interrupt) Handler
The SPARC Trap and Interrupt Handler
Interrupt Distribution Policies
Interaction with Processor Sets and Dynamic Reconfiguration
Monitoring Interrupts
System Calls
Fast Trap System Calls
Addition of a Dynamically Loadable System Call
System Clocks and Timers
System Clock
High-Resolution Timer
Watchdog Timer
The Kernel Callout Table
Solaris 2.5.1 Callout Tables
Summary

Chapter 4: Kernel Synchronization Primitives

Parallel Systems Architectures
Introduction to Synchronization Objects
Hardware Considerations for Locks and Memory Synchronization
Mutex Locks
Overview
Implementation
Reader/Writer Locks
Solaris 2.5.1 RW Lock Implementation Differences
Solaris 2.6 and Solaris 7 RW Locks
Turnstiles and Priority Inheritance
Solaris 2.5.1 and 2.6 Turnstiles
Solaris 7 Turnstiles
Dispatcher Locks
Kernel Semaphores
Summary

Part Two: Threads, Processes, and IPC

Chapter 5: The Solaris Multithreaded Process Architecture

Architecture of a Process
The Process
Process Image
The Process Structure
The User Area (uarea)
The Lightweight Process (LWP)
The Kernel Thread (kthread)
The Kernel Process Table
Process Creation
Process Termination
Deathrow
Signals
Signal Implementation
Synchronous Signals
Asynchronous Signals
SIGWAITING: A Special Signal
Sessions and Process Groups
Summary

Chapter 6: The Solaris Dispatcher

Overview
Scheduling Classes
Dispatch Tables
The Kernal Dispatcher
Dispatch Queues
Thread Priorities
Dispatcher Functions
Dispatcher Queue Insertion
Thread Preemption
The Heart of the Dispatcher: swtch()
The Kernel Sleep/Wakeup Facility
Condition Variables
Sleep Queues
Putting a Kernel Thread to Sleep
The Wakeup Mechanism
Scheduler Activations
LWP Pool Activation
Summary

Chapter 7: Solaris Resource Management

Introduction
Decay Algorithms
Comparison to BSD Style Priority Decay
Usage Decay and Process Priority Decay
Process Priority Decay
Usage Decay
Practical Effects of Decay Factors
Characteristics of the Default Process Priority
Characteristics of the Default User Usage Decay
Setting Decay and ascheduler Parameters
Group Scheduling
Other Parameters
Monitoring Solaris Resource Manager

Chapter 8: Interprocess Communication

Generic System V IPC Support
Resource Maps
System V Shared Memory
Shared Memory Kernel Implementation
Intimate Shared Memory (ISM)
System V Semaphores
Semaphore Kernel Resources
Kernel Implementation of System V Semaphores
Semaphore Operations Inside Solaris
System V Message Queues
Kernel Resources for Message Queues
Kernel Implementation of System V Semaphores
POSIX IPC
POSIX Shared Memory
POSIX Semaphores
POSIX Message Queues
Solaris Doors
Doors Implementation

Part Three: The Solaris File I/O System

Chapter 9: Solaris File I/O

File Types
Directory Files
Special Files
File Links
Hard Links
Symbolic Links
File Modes
Set Userid on Execution
File Locking
The Sticky Bit
File APIs
Standard I/O
C Runtime File Handles
The Standard I/O File Handle
Standard I/O Limits
Standard I/O Buffer Sizes
System File I/O
The Solaris Kernel File Table
File I/O System Calls
System File Open Limits
The open and close System Calls
The read and write System Calls
File Open Modes and File Descriptor Flags
Nonblocking I/O
Exclusive open
File Append Flag
Data Integrity and Synchronization Flags
Other File Flags
The dup System Call
The pread and pwrite System Calls
The readv and writev System Calls
Asynchronous I/O
File System Asynchronous I/O
Kernel Asynchronous I/O
Memory Mapped File I/O
Mapping Options
Mapping Files into Two or More Processes
Permission Options
Providing Advice to the Memory System
The MADV_DONTNEED Flag
The MADV_WILLNEED Flag
The MADV_SEQUENTIAL Flag
The MADV_RANDOM Flag
64-bit Files in the Solaris Operating Environment
64-bit Device Support in Solaris 2.0
64-bit File Application Programming Interfaces in Solaris 2.5.1
Solaris 2.6: The Large-File OS
The Large-File Summit
Large-File Compilation Environments
File System Support for Large Files

Chapter 10: Solaris File Systems

Why Have a File System?
Support for Multiple File System Types
Regular (On-Disk) File Systems
Allocation and Storage Strategy
Block-Based Allocation
Extent-Based Allocation
Extentlike Performance from Block Clustering
File System Capacity
Variable Block Size Support
Access Control Lists
Logging (Journaling) File Systems
Metadata Logging
Logging of Both Data and Metadata
Log-Structured File System Features
Expanding and Shrinking File Systems
Direct I/O
Sparse Files
Integrated Volume Management
Summary of File System Features
The Solaris UFS File System
UFS Inodes
UFS Directions
UFS Links
File System Layout
UFS Block Allocation
File System Performance Considerations
File System Workload Profiles
Data or Attribute Intensive?
Access Patterns
Bandwidth
I/O Size
Latency Sensitivity
Data-Intensive Sequential Workloads
Read-Ahead Helps Sequential Performance
UFS Read-Ahead
Choosing Read-Ahead Cluster Sizes
Setting Cluster Sizes for RAID Volume
Limitations of UFS Read-Ahead
VxFS Read-Ahead
LSI QFS Read Ahead
Storage Device Read-Ahead
Read-Ahead with Memory Mapped Files
File System Write-Behind
UFS Write-Behind
The UFS Write Throttle
Write Throttle in Veritas VxFS
LSI QFS Write Throttle
RAID Level 5 Stripes and Cluster Alignment
The Effect of Logging on Performance
Synchronous Writes
VxFS Synchronous Writes
UFS File Hints
UFS Statistics
Disabling UFS Access Time Updates
Data-Intensive Random Workloads
The Solaris File System Cache
The Solaris Page Cache
The Old Buffer Cache in Solaris
The Page Cache and the Virtual Memory System
File System Paging Tricks
Freeing the Cache for a File System
Freeing the Cache for a File
Free-Behind Algorithms
Read Free-Behind Algorithms
Write Free-Behind on the UFS
Free-Behind with Mapped Files
Closing a File on UFS
Closing a File on VxFS
Closing a File on NFS
Is All That Paging Bad for My System?
Paging Parameters That Affect File System Performance
A Summary of VM Parameters That Affect File Systems
The fsflush Process
Bypassing the Page Cache with Direct I/O
UFS Direct I/O
Direct I/O with Veritas VxFS
The Directory Name Cache
Inode Cache Sizes
UFS Inode Cache Size
The VxFS Inode Cache

Chapter 11: File System Architecture

Solaris File System Framework
Interface Stability
The vfs Object
The vnode Object--A Virtual File Abstraction
The Life Cycle of a Vnode
Paged Vnodes
The Directory Name Lookup Cache
DNLC Operation
The new DLNC Algorithm
DNLC Support Functions
File System I/O
Memory Mapped I/O
Read and Write System Calls
Internals of a Disk-Based File System
Relationship Between Vnodes and Inodes
Initializing and vfs Instantiation
The Block Map Algorithms
File System Directory Implementation
The vop_readdir Method
The vop_lookup Method
The File System Read Method
The File System Write Method
Freeing Vnodes-The Inode Idle List
Placing Inodes onto the Inode Idle List

Part Four: The Solaris Memory System

Chapter 12: Solaris Memory Architecture

Why Have a Virtual memory System?
The Solaris Virtual Memory Implementation
Pages--The Basic Unit of Solaris Memory
Global Page Lists
The Page Level Interfaces
The Page Throttle
Page Sizes
Large Pages
Page Locking Primitives
Virtual Address Spaces
Sharing of Executables and Libraries
Virtual Memory Protection Modes
Memory Exceptions and Page Faults
SPARC Address Spaces
Intel Address Space Layout
Process Memory Allocation
Stack Mapping
Virtual Memory Watch Points
Address Space Management
Memory Segments
The vnode Segment--seg_vn
Memory Mapped Files
Shared Memory Mapped Files
The Copy-On-Write
Page Protection and Advise
Anonymous Memory in seg_vn
The Anonymous Memory Layer
The swapfs Layer
Anonymous Memory Accounting
The seg_map Segement
The Hardware Address Translation Layer
Address Spaces and Address Space Contexts
Hardware Translation Acceleration
The UltraSPARC I & II HAT
Address Space Identifiers
Watchpoint Implementation
UltraSPARC I & II Protection Modes
UltraSPARC I & II MMU Generated Traps
Page Coloring
Page Interleaving
Large Pages
TLB Performance and Large Pages
Solaris Support for Large Pages
Large Page Implementation
The Page Scanner
Page Scanner Operation
Pageout Algorithm and Parameters
Scan Rate Parameters
Not Recently Used Time
Shared Library Optimizations
The Priority Paging Algorithm
Page Scanner CPU Utilization clamp
Parameters that limit pages paged out
Summary of Page Scanner Parameters
Page Scanner Implementation
The Memory Scheduler
Soft Swapping
Hard Swapping
Kernel Memory
Kernel Virtual Memory Layout
Kernel Memory Allocation
Low Level Page Allocation
The Pageable Kernel Memory Segement
Physical memory: physmem, prtdiag, bus arch

Chapter 13: Solaris Memory Sizing

A Quick Introduction to Solaris Memory
How is my memory being used?
Total Physical Memory
File Buffering Memory
Kernel Memory
Free Memory
Do I have a Memory Shortage?
How much memory am I using?
All about Swap space and dump devices
Memory Sizing and Capacity Planning
Sizing a desktop system
The performance trade-off for desktops
System Daemon Memory Requirements
Memory used by system libraries
Operating System (Kernel) Memory
CDE Memory Requirements
Total sktop memory requirements
Sizing a server application
Process Memory Requirements
System Processes
Background Processes
Per-User Processes
Memory used by system libraries
Buffer Cache Memory
System V Shared Memory
Operating System (Kernel) Memory
Summary - Sizing our DB2 Example
Sizing Swap Space
Memory Monitoring and Analysis
The vmstat and swap commands
Free Memory
Swap Space Utilization
Paging Counters
Systems with little or no filesystem I/O
Systems with a lot of filesystem I/O
Kernel Memory
Using Sar to Look at Kernel Memory Allocation
Using crash for detailed kernel memory allocation
Kernel Allocation Methods
The kmastat Command
Using ipcs to display shared memory
MemTool - Unbundled Memory Tools
Tools Provided with MemTool
Basis of Operation
Process memory usage and the pmem command
Buffer cache memory
Using the MemTool GUI
Buffer Cache Memory
Process Memory
Process Matrix
GUI Options
The Workspace Monitor Utility - WSM
Finding Memory Leaks with DBX
The Run-time Leak Checker
Compiling the program
Running the Leak Test

Appendix A: Solaris Limits and Maximum Sizes

Appendix B: Kernel Virtual Address Maps

Appendix C: Kernel Parameters and Switches

Appendix D: A Sample Pseudo File System

Bibliography

Index