Linux Operating system : Thrashing and Remedy
-
Upload
ahsen-saeed -
Category
Technology
-
view
553 -
download
1
Transcript of Linux Operating system : Thrashing and Remedy
Muhammad Ahasn Saeed Inside Observer observerinsider.wordpress.com
Twitter @ahsan_danieL
Theme : Microsoft
Linux Operating System
Topics of 1st Assignment
• Page Transfer Management
• Thrashing and Remedy
• Reference String
• Reference Locality
• Working Set
Cloud options
on demand
Reduced cost
and complexity
Rapid response
to business
• Page Transfer
Management
• Thrashing and
Remedy• Reference String
Muhammad Ahsan Saeed 2
•Reference Locality • Working Set
Page Transfer Management
Muhammad Ahsan Saeed 3
In computer operating systems, paging is a memory
management scheme by which a computer stores and
retrieves data from secondary storage for use in main
memory. In this scheme, the operating system retrieves
data from secondary storage in same-
size blocks called pages.
Paging is an important part of virtual
memory implementations in modern operating systems,
using secondary storage to let programs exceed the size
of available physical memory.
Page Replacement Algorithms
Muhammad Ahsan Saeed
Page replacement algorithms are the techniques using
which Operating System decides which memory pages to
swap out, write to disk when a page of memory needs to
be allocated. Paging happens whenever a page fault
occurs and a free page cannot be used for allocation
purpose accounting to reason that pages are not available
or the number of free pages is lower than required pages.
5
Thrashing and Remedy
After completing initialization, most programs operate on a small number of code and data pages
compared to the total memory the program requires.
The pages most frequently accessed are called the working set.
Thrashing occurs on a program that works with huge data structures, as its large working set causes
continual page faults that drastically slow down the system
Muhammad Ahsan Saeed
Reference String
The latter choice produces a large number
of data, where we note two things :
For a given page size we need to consider only the page number, not the
entire address.
If we have a reference to a page p, then any immediately following
references to page p will never cause a page fault. Page p will be in
memory after the first reference; the immediately following references
will not fault.
For example :
consider the following sequence of addresses – 123 , 215 , 600 , 1234
If page size is 100 then the reference string is 1 , 2 , 6 , 12.
Reference String
Definition
The string of memory references is
called reference string. Reference
strings are generated artificially or by
tracing a given system and recording
the address of each memory
reference.
Muhammad Ahsan Saeed 7
Reference Locality
Reference Locality
Spatial locality Branch locality
Increase own agility Specific security controls
9
In computer science, locality of reference, also known as the principle of locality, is a term for the
phenomenon in which the same values, or related storage locations , are frequently accessed.
Types of locality
Temporal locality
Increase own agility
Muhammad Ahsan Saeed
Reference Locality Discussing about the types of locality.
SLIf a particular memory location is referenced at a particular time, then it is likely that nearby memory
locations will be referenced in the near future. In this case it is common to attempt to guess the size and
shape of the area around the current reference for which it is worthwhile to prepare faster access.
BLIf there are only a few possible alternatives for the prospective part of the path in the spatial-temporal
coordinate space. This is the case when an instruction loop has a simple structure, or the possible outcome of
a small system of conditional branching instructions is restricted to a small set of possibilities.
TL
Muhammad Ahsan Saeed 10
Working Set
Working Set
After completing initialization, most programs operate on a
small number of code and data pages compared to the total
memory the program requires. The pages most frequently
accessed are called the working set.
Muhammad Ahsan Saeed 12
Cache Coherence
Cache Concurrency
Cache Coherence
In computer science, cache coherence is the consistency of shared resource data that
ends up stored in multiple local caches. When clients in a system maintain caches of a
common memory resource, problems may arise with inconsistent data, which is
particularly the case with CPUs in a multiprocessing system.
14Muhammad Ahsan Saeed
Cache Coherence [Detail]
shared memory multiprocessor
separate cache memory for each processor
possible to have many copies of any one instruction operand
one copy in the main memory and one in each cache memory.
When one copy of an operand is changed, the other copies of the operand must be
changed also.
15Muhammad Ahsan Saeed
Cache Coherency
Consistency means that each user sees a consistent view of the data, including the
visible changes made by the users? own transactions, as well as the transactions of
other users. Oracle automatically supplies a query with read-consistent data, so that all
data that the query sees comes from a single point in time (statement-level read
consistency).
16Muhammad Ahsan Saeed
In computing, cache coherence (also cache coherency) refers to the consistency of
data stored in local caches of a shared resource. Cache coherence is a special case of
memory coherence. When clients in a system maintain caches of a common memory
resource, problems may arise with inconsistent data.
17Muhammad Ahsan Saeed
Thank you