You are on page 1of 20

Seminar on Comparison on different OS (Unix, Linux, Windows)

Comparing Architectures
Scheduling Memory Management- Paging File management Security Speed

Scheduling

Scheduling
Windows
Two scheduling classes
Real time (fixed) priority 16-31 Dynamic - priority 1-15
Fixed 31

16 15 Dynamic I/O

Higher priorities are favored.


A thread runs until it is preempted by a higherpriority thread. Uses RR Scheduling, i.e. a time quantum is allocated to each thread.

Windows

Scheduling
Linux
0

Has 2 scheduling classes: Dynamic priority 100-139 Fixed RR priority 0-99 Lower priorities are favored Priorities of normal threads go up (decay) as they use CPU Priorities of interactive threads go down (boost) Linux assign higher-priority task longer time quantum

Fixed Round-Robin

99 100 Normal 140

I/O

CP

Linux

Scheduling
Unix No scheduling classes are created in UNIX. CPU scheduling in UNIX is designed to benefit interactive process.

Processes are given small time slices (approx 0.1 sec).


It uses RR Scheduling scheme.

Higher priorities are favored.


The more CPU time a process accumulates, the lower is its priority.

Memory Management

Virtual Memory Management


Windows 32-bit versions split usermode/kernel-mode from 2GB/2GB to 3GB/1GB Demand-paged virtual memory
32 or 64-bits Copy-on-write Shared memory Memory mapped files
0 User 2GB System 4GB

Linux Splits user-mode/kernel-mode from 1GB/3GB to 3GB/1GB


2.6 has 4/4 split option where kernel has its own address space

Demand-paged virtual memory


32-bits and/or 64-bits Copy-on-write Shared memory Memory mapped files

0 User

3GB System 4GB

Physical Memory Management


Windows Per-process working sets
Working set tuner adjust sets according to memory needs using the clock algorithm

Linux
Global working set management uses clock algorithm

No swapper
LRU Process

No swapper (the working set trimmer code is called the swap daemon, however)

Reused Page LRU Other Process


Reused Page

LRU

I/O Management
Windows
Centered around the file object Layered driver architecture throughout driver types Most I/O supports asynchronous operation Internal interrupt request level (IRQL) controls interruptability Interrupts are split between an Interrupt Service Routine (ISR) and a Deferred Procedure Call (DPC) Supports plug-and-play

Linux Centered around the vnode No layered I/O model Most I/O is synchronous
Only sockets and direct disk I/O support asynchronous I/O

Internal interrupt request level (IRQL) controls interruptability Interrupts are split between an ISR and soft IRQ or tasklet Supports plug-and-play

IRQL Masked

File Management

File Caching
Windows
Single global common cache Virtual file cache
Caching is at file vs. disk block level Files are memory mapped into kernel memory

Linux
Single global common cache Virtual file cache
Caching is at file vs. disk block level Files are memory mapped into kernel memory

Cache allows for zero-copy file serving

Cache allows for zero-copy file serving

File Cache

File Cache

File System Driver

File System Driver

Disk Driver

Disk Driver

Monitoring - Linux procfs


Linux supports a number of special filesystems
Like special files, they are of a more dynamic nature and tend to have side effects when accessed

Prime example is procfs (mounted at /proc)


provides access to and control over various aspects of Linux (I.e.; scheduling and memory management)
/proc/meminfo contains detailed statistics on the current memory usage of Linux Content changes as memory usage changes over time

Services for Unix implements procfs on Windows

I/O Processing
Linux 2.2 had the notion of bottom halves (BH) for lowpriority interrupt processing
Fixed number of BHs Only one BH of a given type could be active on a SMP

Linux 2.4 introduced tasklets, which are non-preemptible procedures called with interrupts enabled Tasklets are the equivalent of Windows Deferred Procedure Calls (DPCs)

Security

Security
Windows

Very flexible security model based on Access Control Lists Users are defined with Privileges Member groups Security can be applied to any Object Manager object Files, processes, synchronization objects, Supports auditing Concept of user id and password ,but optional.

Security
Linux

Two models: Standard UNIX model Access Control Lists (SELinux) Users are defined with: Capabilities (privileges) Member groups Security is implemented on an object-by-object basis Has no built-in auditing support Concept of user id and password.

security
unix

Further Reading
Transaction Processing Council: www.tpc.org SPEC: www.spec.org NT vs Linux benchmarks: www.kegel.com/nt-linuxbenchmarks.html The C10K problem: http://www.kegel.com/c10k.html Linus Torvalds home: http://www.osdl.org/ Linux Kernel Archives: http://www.kernel.org/ Linux history: http://www.firstmonday.dk/issues/issue5_11/moon/ Veritest Netbench result: http://www.veritest.com/clients/reports/microsoft/ms_netbench.pdf Mark Russinovichs 1999 article, Linux and the Enterprise: http://www.winntmag.com/Articles/Index.cfm?ArticleID=5048 The Open Group's Single UNIX Specification: http://www.unix.org/version3/

You might also like