Page Faults & Page Fault Handling in Operating Systems | Page Fault Numerical Example | Thrashing

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • Support Simple Snippets by Donations -
    Google Pay UPI ID - tanmaysakpal11@okicici
    PayPal - paypal.me/tanmaysakpal11
    --------------------------------------------------------------------------------------------- In this Operating systems - Memory Management video tutorial we will study and understand what is Page fault, how it happens and the entire process of Page Fault Handling in OS.
    We will also understand what is Thrashing.
    Page faults -
    When a program tries to reference a page not currently present in RAM, the processor treats this invalid memory reference as a page fault and transfers control from the program to the operating system.
    The operating system must:
    1. Determine the location of the data on disk.
    2. Obtain an empty page frame in RAM to use as a container for the data.
    3. Load the requested data into the available page frame.
    4. Update the page table to refer to the new page frame.
    5. Return control to the program, transparently retrying the instruction that caused the page fault.
    Thrashing -
    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.
    When the working set is a small percentage of the system's total number of pages, virtual memory systems work most efficiently and an insignificant amount of computing is spent resolving page faults. As the working set grows, resolving page faults remains manageable until the growth reaches a critical point. Then faults go up dramatically and the time spent resolving them overwhelms time spent on the computing the program was written to do. This condition is referred to as thrashing. 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. Satisfying page faults may require freeing pages that will soon have to be re-read from disk.
    Simple Snippets Official Website -
    simplesnippets....
    Simple Snippets on Facebook -
    / simplesnippets
    Simple Snippets on Instagram -
    / simplesnippets
    Simple Snippets on Twitter -
    / simplesnippet
    Simple Snippets Google Plus Page -
    plus.google.co...
    Simple Snippets email ID -
    simplesnippetsinfo@gmail.com
    For More Technology News, Latest Updates and Blog articles visit our Official Website - simplesnippets....
    #PageFaults #Paging #OperatingSystems #OS

КОМЕНТАРІ • 63

  • @SimpleSnippets
    @SimpleSnippets  5 років тому +7

    Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

    • @vishalagarwal4766
      @vishalagarwal4766 4 роки тому +1

      Effective access time cannot be lesser than the memory access time when there is no page fault. It should come out to be 101 ms instead of 91 ms. This mistake has occurred because you have not added the usual (when there is no page fault) access time to the overhead in case of page fault before multiplying it by 0.1.
      Also, comprehensive explanation otherwise. This was a great help.

  • @shubhamupadhyay6861
    @shubhamupadhyay6861 5 років тому +15

    Your explanation was superrb.....
    I liked it a lot....
    Just resolve my query

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      Thanks for the response buddy. I guess you used the formula wrong :-)

  • @chinnuyadav6897
    @chinnuyadav6897 4 роки тому +11

    hey! there.Thank you so much. I could understand every concept of OS a day before exam cuz of your videos.

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому +3

      Most welcome buddy. I would request you to please share the videos and channel with your friends too. Thats the biggest help and support for the channel 😇

  • @ritteshpv2196
    @ritteshpv2196 2 роки тому +1

    It was really clean how you explained the thrashing from what's needed to understand how the thrashing happens !

  • @AryanKumar-wn1yd
    @AryanKumar-wn1yd 4 роки тому +15

    Your EAT calculation is wrong. The EAT is coming to be lower than memory access time after 10% page fault.
    The correct calculation would bb 0.9 * 100 + 0.1 *(100 + 10) = 101ms

  • @chandannene281
    @chandannene281 2 роки тому +4

    Rather than (1-P)* + P*, EAT should be = + P*.
    This is because irrespective of page fault or not, memory access time is going to be there always.

    • @kemalkubilayylmaz4142
      @kemalkubilayylmaz4142 Рік тому

      Page fault overload process already includes the memory access time. So, if you put 1 instead of (1-p), you count the memory access time in page fault overload process twice

    • @michaelvt2267
      @michaelvt2267 Рік тому +2

      @@kemalkubilayylmaz4142The page fault overload in the example should be 110ms instead of 10ms which is used in the example calculation.

  • @mamo100
    @mamo100 Рік тому +3

    Tanks for video.
    I hade a question about "page fault overlaod" in 10:35 : shoulden´t it be 110?
    because "Momory access time" includes in page fault overload.

  • @AdMrAuZmImNeGr
    @AdMrAuZmImNeGr Рік тому +1

    Fantastic explanation. Thank you, sir!

  • @WADS-rr9wy
    @WADS-rr9wy 4 роки тому +2

    Thanks so much you explain computing so well!

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому

      Thank you so much Thomas, really glad to hear this from you. Please do subscribe to this channel & share the content with your friends too. That will be the biggest help & support 😇

  • @vikaskumarsingh3608
    @vikaskumarsingh3608 5 років тому +3

    Well explained, thank you

    • @SimpleSnippets
      @SimpleSnippets  5 років тому

      Thank you so much Vikas. Please share the video with your friends as well. That will be really helpful and the best support ✌

  • @abcdabcd8605
    @abcdabcd8605 Рік тому +1

    excellent explanation

  • @emircimen9060
    @emircimen9060 9 місяців тому +1

    thank you mr indian sirmen.

  • @randywa
    @randywa 5 місяців тому

    Great explanation. It made perfect sense.
    I’m slightly curious about the test question though. Wouldn’t it actually be .9*100 + .1*110 which is 101? Because 10% of the time we have page fault overhead which adds to the already existing access time right? You could also think about it as 100% of the time, memory access is 100ms, but then 10% of the time there will be an extra 10ms which means it’s 1*100 + .1*10 = 101

  • @Gurdat555555555
    @Gurdat555555555 3 роки тому +1

    Thank you! This video was very helpful!

  • @deepamgupta8011
    @deepamgupta8011 4 роки тому +1

    Clear cut and simple boss...

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому

      Thank you Deepam 🤟 I try to keep it short simple and sweet 😇
      Please do Subscribe & share with your friends. That's the biggest help and support ✌️

  • @adityakulkarni3396
    @adityakulkarni3396 5 років тому +1

    Hey man , thanks for such an awesome explanation !!!

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      Most welcome bro 😁 I'm glad you liked it. Please share the video with your friends too ✌️

  • @amandatao9622
    @amandatao9622 Рік тому +1

    Thank you!!!

  • @--sql
    @--sql 4 роки тому +1

    This helped me a lot, thank you!

  • @rtlinsn5085
    @rtlinsn5085 5 років тому +2

    Thank you very much, well explanation.
    I have a question. Is there a way to predict or count the number of page faults? either statically or at run-time?

  • @rajmourya35
    @rajmourya35 3 роки тому +1

    Amazing video/explanation man.

  • @keshavkattel
    @keshavkattel 3 роки тому

    very nice explanation brother.

  • @shaharrefaelshoshany9442
    @shaharrefaelshoshany9442 2 роки тому +1

    Best ever

    • @SimpleSnippets
      @SimpleSnippets  2 роки тому

      Thanks bro, I'm glad to hear this. Please do share the videos with your friends too. That's the biggest help and support you can give back to me 🙏😊

  • @neerajkukreja8997
    @neerajkukreja8997 4 роки тому +1

    The explanation was very good. Can you give the notes of page fault also in the way you have given for paging

  • @avichalkumar8758
    @avichalkumar8758 3 роки тому +1

    Everything is good,but please make a subject wise playlist
    Like paging videos in Operating systems playlist

  • @Venkymsd
    @Venkymsd 3 роки тому

    Nice explanation

  • @shubhamupadhyay6861
    @shubhamupadhyay6861 5 років тому +4

    Bhai ye page fault waale question ka answer galat hai......
    Answer 101 hoga....
    ((0.9*100)+(0.1*(100+10)))=101...
    In this question 100 second will be memory access time + 10 seconds will be penalty for page fault....

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      Good question, well you have applied the formula incorrectly buddy. the second part is (probability of failure * the overhead time) and not the total time with overhead. the overhead time generally itself this the time taken to perform all the page fault activities itself :-)

    • @shubhamupadhyay6861
      @shubhamupadhyay6861 5 років тому +3

      @@SimpleSnippets dear,
      We will only get to know that demanded page is missing in the primary memory when we will access it.....
      So we should add access time to page fault time......
      This is my last argument.....
      Please resolve it.......

    • @johannsebastianbach3411
      @johannsebastianbach3411 4 роки тому +1

      By the videos logic, it would be slower to access pages if all pages were already in the frame:
      (1-0)*100+(0*10) = 100 > 91
      I agree with Shubham.
      We still do memory access for the small portion of cases with page fault, but we also waste time retrieving them from hdd. So it should be ((1-p)* (t memory)) + p * (t memory + overhead)

  • @erikasong3054
    @erikasong3054 4 роки тому +1

    Thank you so much, Sir, for this video! You are amazing! SUBSCRIBED :D

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому +1

      Thank you so much buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @johannsebastianbach3411
    @johannsebastianbach3411 4 роки тому +6

    Thanks for the tutorial, however, i have an issue with something.
    Imagine if all pages were in hdd and no pages are in memory.
    Then the access time is: 0*100 + 1* 10 = 10 ms
    But if everything was in memory already:
    1*100+0*10 = 100
    How is accessing pages in memory slower than retrieving from hdd?

    • @yxlxfxf
      @yxlxfxf 4 роки тому +2

      I thought the same thing, I think the page fault access time should be memory access time + page fault overhead = 110 ms

    • @vishalagarwal4766
      @vishalagarwal4766 4 роки тому +1

      @@yxlxfxf Exactly. That hasn't been addressed properly. You have to add the memory access time with the overhead.

    • @julesbamwe6061
      @julesbamwe6061 4 роки тому

      @@yxlxfxf You need to use the probability since not all pages will be in the secondary memory. it might be there not there. the answer should be greater or equal to 100 and less than 110

    • @yxlxfxf
      @yxlxfxf 4 роки тому

      @@julesbamwe6061 The average memory access time would be between 100 and 110, I was referring to the time for one single page fault

    • @julesbamwe6061
      @julesbamwe6061 4 роки тому

      @@yxlxfxf exact... Then u are right in that case. Obvious 110.

  • @kinjalshah2796
    @kinjalshah2796 3 роки тому

    Thanks for sharing info. Just one question.. how paging (VM) created in secondary memory?

  • @colinrhee98
    @colinrhee98 3 роки тому +3

    Is there a way I can download the diagram, I haven't found any other diagrams that come close to the level of detail you present.

  • @peter0702
    @peter0702 3 роки тому

    Why EAT is shorter than memory access time??? Why it seems the more page fault happens, the shorter EAT is??
    I understand the formula, but are the numbers realistic?

  • @MrNomay
    @MrNomay 3 роки тому +1

    Love from Pakistan bro❤️

  • @Samtoosoon
    @Samtoosoon 6 місяців тому

    No page found, finds secondary storage, bring into free frame, update page table, restart instruction

  • @zahreddinesoualem3213
    @zahreddinesoualem3213 5 років тому

    in step 4 is the MMU that takes p3 3 to the main memory or OS ?

  • @Berk45632
    @Berk45632 5 місяців тому

    10:54 I believe your numerical problem example is not the best example. If memory access time is 100ms, how can the page fault overhead be 10ms?
    Page fault overhead = memory access to page table + memory access to secondary storage + updating page table in memory + restarting the instruction
    so if memory access time is itself 100ms, then page fault overhead needs to be at least 4x the memory access. Your formula is right, but the example doesn't make any sense.

  • @Blooderstokizz
    @Blooderstokizz 3 роки тому

    Why are you missing TLB memory ?

  • @kunalsamnani6782
    @kunalsamnani6782 3 роки тому

    Semaphore daal do yaar