solaris cs 450-2 dr. abzug alex blood mike henry james sheasley david waterman

27
Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Upload: dacey

Post on 06-Jan-2016

25 views

Category:

Documents


0 download

DESCRIPTION

Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman. Introduction. Brief History Multiprocessor Support Dealing With Deadlock CPU Scheduling Virtual Memory Conclusion. Brief History. AT&T’s Bell Labs 1969 Berkley Standard Distribution 1977 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Solaris

CS 450-2Dr. Abzug

Alex BloodMike Henry

James SheasleyDavid Waterman

Page 2: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Introduction

• Brief History

• Multiprocessor Support

• Dealing With Deadlock

• CPU Scheduling

• Virtual Memory

• Conclusion

Page 3: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Brief History

• AT&T’s Bell Labs 1969

• Berkley Standard Distribution 1977

• Department of Defense

• AT&T Sun Microsystems Alliance:

Unix System V Release 4

• Solaris 9 OE

• Solaris 9 OE x86 Early Access (Dec. 2)

Page 4: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Multiprocessing

The Solaris kernel includes:• Concurrency on symmetric multiprocessors• Adaptive mutual-exclusion locks• Interrupts handled as independent threads• Fully preemptible, soft real-time support• Lightweight Processes

Page 5: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Interrupts Handled As Threads

• When an interrupt occurs, a new thread is associated with it

• Partially initialized threads are created beforehand by the kernel to save time when an interrupt occurs

• The interrupt data is pushed onto the stack of the partially initialized thread, using minimal resources

Page 6: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Soft Real-Time Support

• The kernel is preemptible at most points, but not all

• When the kernel is in a non-preemptible state, there is a time limit defined by the hardware before it has to enter a preemptible state

Page 7: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Lightweight Processes

• Kernel-supported threads of control in a user process

• Each LWP is associated with a kernel thread

Page 8: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Lightweight Processes (Cont)

• LWPs share address space with the process, and process resources

• LWPs allow a user process to have thousands of threads without overwhelming the kernel

Page 9: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Dealing With Deadlocks

• Prevention by treating interrupts as threads

• Prevention using mutexes

• Detection by priority inheritance mechanism

• Do nothing, when priority inheritance mechanism does not detect the deadlock

Page 10: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Solaris CPU Scheduling

James J. Sheasley

Page 11: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Process Scheduling

Process States• Running• Sleeping• Ready

Scheduling Classes• Timesharing• Interactive• System• Real Time

Page 12: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Timesharing

Regular user work. The CPU is rotated between threads at the same priority by time slicing. Compute-bound operations have their priority lowered and I/O-bound operations have their priorities raised.

Page 13: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Interactive

Interactive class. This is the same as the Time Sharing class with the addition of a priority increase that is given to the task in the active window.

The active window has the highest priority among normal user processes.

Page 14: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

System

Kernel priorities. This class is used for system threads. The CPU is not shared amongst these threads by time slicing. These system threads run until finished or pre-empted. Fixed priority levels are utilized in this class of processes.

Page 15: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Real Time

Processes that require immediate system access, such as critical hardware systems. Interrupt handling is the only classification that gets higher priority that Real Time. Threads will share the CPU through time slicing if they have the same priority. Real time threads have a priority that is constant for the duration of their existence.

Page 16: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Scheduling Class Priorities

Class Priority

Time Sharing

0-59

Interactive 0-59

System 60-99

Interrupt 100-109

Class Priority

Time Sharing

0-59

Interactive 0-59

System 60-99

Real Time 100-159

Interrupt 160-169

Page 17: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Time Slicing

ts_quantum the default length of time assigned to a process with the specified priority.

ts_tqexp the new priority that is assigned to a process that uses its entire time quantum.

ts_slpret the new priority assigned to a process that blocks before using its entire time quantum.

ts_maxwait If a thread does not receive CPU time during a time interval of ts_maxwait, its priority is raised to ts_lwait.

ts_lwait

Page 18: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Thundering Heard

• Multiple threads waiting on a single resource.

• All threads awoken when resource becomes free.

• Additional “inherited” priority property attempts to limit “mad dash” for the resource.

Page 19: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Virtual Memory

• Demand Paging - Second Chance Two Handed Algorithm•Clears, then checks periodically•Done in Unison•Difference is the handspread

Page 20: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Page Faults

• Moving page to free list sends it to be written to swap

• Minor page fault – Page is reclaimed before it can be overwritten

• Major page fault – Page must be brought in back from swap

Page 21: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Minimal Paging

• Paging does not happen until free memory falls below lotsfree (1/64 of memory)

• Page Scanner will scan between a boundry (slowscan to fastscan)

• Generally, most parameters are tunable by the sysadmin if necessary.

Page 22: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Soft Swapping

• Tries to keep memory above desfree (half of lotsfree) for a 30 second average

• If unsucessful, soft swapping occurs.• Only swaps idle processes (default is 20

seconds)

Page 23: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Hard Swapping

• Trying to avoid thrashing• 30 second average falls below minfree and

current is below desfree• Even running jobs can be swapped• Favors long running or large processes

Page 24: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Unswappable Processes

• Realtime• Executed by a signal• Exiting• Zombie• System Thread• Blocking a higher priority thread

Page 25: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Priority Paging (Solaris 2.6)

• Cache Pollution hurting performance• Program Data now favored over File

Cache• Enabled 2x lotsfree• Only free file cache when free memory is

between lotsfree and cachefree• Pager gets confused if the file has the

executable bit set

Page 26: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Cyclical Page Cache (Solaris 8)

• Two seperate lists for file cache and program data

• Sun Claims:• Higher Page Reclaims• Higher Free Memory Values• “Zero” Scan Rates

Page 27: Solaris CS 450-2 Dr. Abzug Alex Blood Mike Henry James Sheasley David Waterman

Conclusion

• “The Network is the computer” – Sun MicroSystems

• Solaris 9 OE• Questions?