0% found this document useful (0 votes)
47 views5 pages

Effective Access Time and Page Fault Analysis

The document discusses Effective Access Time (EAT) calculations in relation to page faults, detailing the formula and scenarios for performance degradation. It highlights that a page fault rate must be below 0.0000025 to keep degradation under 10%, and illustrates thrashing with an example of excessive page faults in a limited memory scenario. Additionally, it provides calculations for EAT based on different page fault rates, demonstrating the impact of page faults on memory access times.

Uploaded by

Muhammad Zubair
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views5 pages

Effective Access Time and Page Fault Analysis

The document discusses Effective Access Time (EAT) calculations in relation to page faults, detailing the formula and scenarios for performance degradation. It highlights that a page fault rate must be below 0.0000025 to keep degradation under 10%, and illustrates thrashing with an example of excessive page faults in a limited memory scenario. Additionally, it provides calculations for EAT based on different page fault rates, demonstrating the impact of page faults on memory access times.

Uploaded by

Muhammad Zubair
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Example

Memory Access Time (MAT) = 200 nanoseconds = 0.2 microseconds

Average Page-Fault Service Time (PFST) = 8 milliseconds = 8000


microseconds

EAT (Effective Access Time) = (1 - p) x MAT + p x PFST

Where p is the probability of a page fault occurring.

Formula for EAT:

EAT=(1−p)×200+p×8,000,000

EAT=(1−p)×200+p×8,000,000

EAT=200+p×7,999,800

EAT=200+p×7,999,800

Scenarios Conditions
A. You are told that one page fault out of 1,000 memory accesses occurs,
which means the probability

p=11000=0.001p=10001=0.001.

When this happens, EAT = 8.2 microseconds. Let's check if the equation holds
for this scenario:

For p=0.001p=0.001:

EAT=200+0.001×7,999,800

=200+7,999.8

=8,199.8 nanoseconds

=8.2 μs
For the given condition, where the slowdown is indeed by a factor of 40.

The factor of 40 comes from the comparison of the EAT under normal conditions
(200 nanoseconds) versus with page faults (8.2 microseconds).

B. If we want to ensure that the performance degradation is less than 10%.

Degradation= 220 nanoseconds > 200 + 7,999,800 × p

This leads to the inequality:

220 > 200 + 7,999,800 × p

220 > 200 + 7,999,800 × p

20 > 7,999,800 × p

20 >7,999,800 × p

P < 207,999,800 = 0.0000025

P < 7,999,80020 = 0.0000025

Summary
So, the probability pp must be less than 0.00000250.0000025, which means
there should be fewer than one page fault in every 400,000 memory accesses to
ensure that the performance degradation is less than 10%.

Example-2
Demand Paging in Worst-Case:
In the worst-case scenario, thrashing occurs when the operating system spends
most of its time swapping pages in and out of memory, leading to a significant
performance degradation.
Example:
Let’s assume we have a system with a memory capacity of 2 pages, but the
process has 4 pages: A, B, C, and D. If the process accesses pages in a pattern
that constantly forces the operating system to swap pages in and out of memory,
this can lead to thrashing.

Access Pattern:
1. Access page A → Page fault (load page A into memory).
2. Access page B → Page fault (page A is swapped out, and page B is
loaded into memory).
3. Access page C → Page fault (page B is swapped out, and page C is
loaded into memory).
4. Access page D → Page fault (page C is swapped out, and page D is
loaded into memory).
5. Access page A → Page fault (page D is swapped out, and page A is
loaded into memory).
6. Access page B → Page fault (page A is swapped out, and page B is
loaded into memory).
7. Access page C → Page fault (page B is swapped out, and page C is
loaded into memory).
8. Access page D → Page fault (page C is swapped out, and page D is
loaded into memory).
Analysis:

● The system has to swap pages in and out constantly, resulting in many
page faults, even though there are only 4 pages in total.
● The system incurs 8 page faults for just 4 pages because the limited
memory (2 pages) forces the system to replace pages excessively. This is
a classic example of thrashing, where the system spends so much time
swapping pages in and out that it has little time left to perform actual
computation, resulting in very poor performance.

Calculate the EAT


if Memory access time = 200 nanoseconds,
Average page-fault service time = 8 milliseconds

The formula for EAT is:

EAT=(1−p)×Memory Access Time+p×Page Fault Service Time


EAT=(1−p)×Memory Access Time+p×Page Fault Service Time
Where:

p is the page fault rate (the probability that a page fault will occur).
Memory Access Time is the time it takes to access data from memory when there is no page
fault.
Page Fault Service Time is the time required to handle a page fault, which includes the time to
swap a page into memory.

Given:

Memory Access Time = 200 nanoseconds = 200×10−9200×10−9 seconds

Average Page Fault Service Time = 8 milliseconds = 8×10−38×10−3 seconds

pp (the page fault rate) is not provided, so we'll calculate the EAT for a range of page fault rates,
or if you have a specific value for pp, you can use that.

Let's calculate an example p value.

Example 1: If the page fault rate p=0.01p=0.01 (1% of accesses result in a page fault):

EAT=(1−0.01)×200×10−9+0.01×8×10−3

EAT=(1−0.01)×200×10−9+0.01×8×10−3

Now, let's calculate this:

Memory Access Time Contribution:


(1−0.01)×200×10−9=0.99×200×10−9=198×10−9 seconds=198 nanoseconds

Page Fault Service Time Contribution:


0.01×8×10−3=0.08×10−3 seconds=80 microseconds

So, the EAT is:


EAT=198 nanoseconds+80 microseconds

Since 1 microsecond=1000 nanoseconds1 microsecond=1000 nanoseconds, we convert the


result to nanoseconds:
80 microseconds=80×1000=80,000 nanoseconds

Thus, the total EAT is:


EAT=198 nanoseconds+80,000 nanoseconds=80,198 nanoseconds

So, for p=0.01p=0.01, the Effective Access Time is 80,198 nanoseconds.

Common questions

Powered by AI

The access pattern in a worst-case demand paging scenario, such as iteratively accessing pages A, B, C, and D with only 2 pages of memory available, results in constant page replacement. This is evidence of thrashing as every page access incurs a fault, drastically hindering system efficiency. The system is caught in a loop of redundancy, devoted to swapping rather than executing tasks, exemplifying how demand paging without adequate memory management can cripple performance .

To determine the maximum allowable page fault rate that limits performance degradation to less than 10%, one must set a threshold EAT that is within 10% of the normal access time (220 nanoseconds in this context). Using the inequality 20 > 7,999,800 * p derived from this upper limit, p must be less than 0.0000025, implying there should be fewer than one page fault in every 400,000 memory accesses .

Thrashing occurs when the operating system spends a substantial amount of time swapping pages in and out of memory, significantly affecting performance. This often happens in a worst-case scenario where memory is insufficient to hold all required pages, causing continuous page evictions. For example, with a memory capacity of 2 pages and a process comprising pages A, B, C, and D accessed in a cyclic manner, the number of page faults equals the number of accesses, leading to no time left for actual computations as the system is busy handling page faults .

Worst-case demand paging leads to thrashing when a system continuously swaps pages due to insufficient memory for all active processes. For example, with a memory capacity limited to 2 pages, handling a process requiring 4 pages (A, B, C, D) in a manner where each access forces a swap results in 8 page faults for 4 pages accessed. This excessive paging activity results in thrashing, leaving little time for execution of actual tasks, thus severely degrading performance .

Effective Access Time (EAT) illustrates the impact of page faults on system performance by quantifying the average time taken for memory access when both non-faulting and faulting cases are considered. The formula used to calculate EAT is: EAT = (1 - p) * Memory Access Time + p * Page Fault Service Time, where p is the probability of a page fault occurring. For instance, with a memory access time of 200 nanoseconds and average page-fault service time of 8 milliseconds, EAT becomes 200 + p * 7,999,800, transforming the effective performance measure from nanoseconds to possibly microseconds or milliseconds when page faults are more frequent .

Page fault service time significantly impacts the Effective Access Time as it represents the added time burden when a page fault occurs. Expressed in milliseconds (8 ms = 8,000 microseconds), this transforms the EAT from mere hundreds of nanoseconds to potentially several microseconds or even more, depending on the fault rate, thereby highlighting the drastic increase in access time from efficient memory handling to penalty-costly faults .

To convert the Effective Access Time from nanoseconds to milliseconds, one multiplies by 10^-6, reflecting a direct unit conversion. For example, with EAT = 80,198 nanoseconds, converting gives approximately 0.080198 milliseconds. This conversion illustrates system latency by revealing the relative slowness introduced by page faults, displaying how access delays accumulate over massive computations, significantly impacting performance at scale .

To optimize Effective Access Time in environments with frequent page faults, critical considerations include minimizing the page fault rate (p) through improved memory management strategies like increasing physical memory and using more efficient page replacement algorithms, and reducing the page fault service time via faster I/O operations or caching techniques. These considerations directly reduce the components of the EAT formula that account for delays, thereby maintaining swift data retrieval despite potential faults .

The mathematical relationship governing acceptable performance degradation due to page faults is captured in the inequality 220 > 200 + 7,999,800 * p, derived from ensuring that EAT remains less than a 10% increase from the normal access time. The inequality sets an upper limit on p, the page fault rate, thus illustrating that the frequency of page faults directly affects the magnitude of performance loss. By solving this inequality, one ensures that performance degradation due to page faults remains controlled and within limits, maintaining operational efficiency .

The inequality 220 > 200 + 7,999,800 * p derived from the EAT formula informs hardware upgrade decisions by quantifying the impact of page fault frequency and service time on performance. It underscores the necessity for upgrades like additional RAM to reduce p or faster storage subsystems to decrease service time, ultimately suggesting upgrades focused on reducing operational delays and maintaining efficient throughput under varying computational demands .

You might also like