calculate the effective access time

107,796

Solution 1

In the case that the page is found in the TLB (TLB hit) the total time would be the time of search in the TLB plus the time to access memory, so

TLB_hit_time := TLB_search_time + memory_access_time

In the case that the page is not found in the TLB (TLB miss) the total time would be the time to search the TLB (you don't find anything, but searched nontheless) plus the time to access memory to get the page table and frame, plus the time to access memory to get the data, so

TLB_miss_time := TLB_search_time + memory_access_time + memory_access_time

But this is in individual cases, when you want to know an average measure of the TLB performance, you use the Effective Access Time, that is the weighted average of the previous measures

EAT := TLB_miss_time * (1- hit_ratio) + TLB_hit_time * hit_ratio

or

EAT := (TLB_search_time + 2*memory_access_time) * (1- hit_ratio) +
       (TLB_search_time + memory_access_time) * hit_ratio

Solution 2

General Formula for EAT

Hit ratio = a

Main Memory access time = m

Associative Lookup (TLB access) = e

EAT = (m + e) a + (2m + e) (1 - a)

    = 2m - ma + e

Solution 3

The effective time here is just the average time using the relative probabilities of a hit or a miss. So if a hit happens 80% of the time and a miss happens 20% of the time then the effective time (i.e. average time) over a large number of hits/misses will be 0.8 * (hit time) + 0.2 * (miss time).

Solution 4

In TLB a copy of frequently accessed page number and frame no is maintained which is from the page table stored into memory.

It first looks into TLB. If found, it goes to the memory location so the total access time is equals to:

20 + 100 = 120 ns

Now if TLB is missing then you need to first search for TLB, then for the page table which is stored into memory. So one memory access plus one particular page acces, nothing but another memory access. So the total time is equals to:

20 + 100 + 100 = 220 ns

And effective memory access time is equals to:

0.80 * 120 + 0.20* 220 = 140 ns
Share:
107,796

Related videos on Youtube

Aysha Almaqtari
Author by

Aysha Almaqtari

Updated on April 21, 2020

Comments

  • Aysha Almaqtari
    Aysha Almaqtari about 4 years

    This is a paragraph from Operating System Concepts, 9th edition by Silberschatz et al:

    The percentage of times that the page number of interest is found in the TLB is called the hit ratio. An 80-percent hit ratio, for example, means that we find the desired page number in the TLB 80 percent of the time. If it takes 100 nanoseconds to access memory, then a mapped-memory access takes 100 nanoseconds when the page number is in the TLB. If we fail to find the page number in the TLB then we must first access memory for the page table and frame number (100 nanoseconds) and then access the desired byte in memory (100 nanoseconds), for a total of 200 nanoseconds. (We are assuming that a page-table lookup takes only one memory access, but it can take more, as we shall see.) To find the effective memory-access time, we weight the case by its probability: effective access time = 0.80 × 100 + 0.20 × 200 = 120 nanoseconds

    but in the 8th edition of the same book enter image description here

    I'm confused with the

    effective access time

    Can someone explain it for me?

    • Jonathan Leffler
      Jonathan Leffler almost 11 years
      The 'effective access time' is essentially the (weighted) average time it takes to get a value from memory. If you make 100 requests to read values from memory, 80 of those requests will take 100 ns and 20 of them will take 200 (using the 9th Edition speeds), so the total time will be 12,000 ns, for an average time of 120 ns per access. No single memory access will take 120 ns; each will take either 100 or 200 ns. (An average family has 2.3 children, but any real family has 0, 1, 2 or 3 children — or an integer number of children; you don't see many 'three tenths of a child' wandering around).
    • kainaw
      kainaw over 8 years
      The issue here is that the author tried to simplify things in the 9th edition and made a mistake. He tried to combine 20ns access time for the TLB with 80ns time for memory to make a nice 100ns time. If that is the case, a miss will take 20ns+80ns+80ns=180ns, not 200ns. It is a typo in the 9th edition.
  • sqluser
    sqluser over 9 years
    Looks like a comment not an answer
  • qwerty
    qwerty about 8 years
    If it was a 3 level paging system, would TLB_hit_time be equal to: TLB_search_time + 3* memory_access_time and TLB_miss_time be TLB_search_time + 3*(memory_access_time + memory_access_time) and EAT would then be the same?
  • Santiago
    Santiago about 8 years
    @qwerty yes, EAT would be the same. In your example the memory_access_time is going to be 3* always, because you always have to go through 3 levels of pages, so EAT is independent of the paging system used
  • Peter Cordes
    Peter Cordes over 3 years
    That would be true for "miss penalty" (miss time - hit time), but miss time is the total time for a miss so you shouldn't be counting the hit time on top of that for misses.