CS 134 OS-7 Paging HW: Copy-On-Write Fork

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 22

  • @AFPinerosG
    @AFPinerosG Před 3 lety +20

    Let me just say BRAVO! It is so hard to find clear explanations of these topics. I'm a visual learner, I think most people are. These videos are gold.
    Thank you very much!

    • @NeilRhodesHMC
      @NeilRhodesHMC  Před 3 lety +1

      Glad you like them. I'll be posting Deep Learning videos in the spring semester.

    • @marone6611
      @marone6611 Před rokem

      there's no such thing as visual learning

  • @Joe4740
    @Joe4740 Před 3 lety +6

    Been looking through the internet on how this COW thing works. I eventually stopped in the middle of another video, gave up and watched a TV show. Then I dared another round of googling and found this video. Now, I finally get, at least at its core, how this whole thing works. Thank you for a great video and explanation with drawings and everything!

  • @waltersmuts649
    @waltersmuts649 Před 3 lety +4

    Great explanation :) Thanks for uploading these.
    Keen to take a look at all the other lectures too!

    • @NeilRhodesHMC
      @NeilRhodesHMC  Před 3 lety

      Glad you like them. I'll be posting Deep Learning videos in the spring semester.

  • @frankwu9653
    @frankwu9653 Před 10 měsíci

    Have to deal with VMs and qcow2 files. Your visual presentation is very helpful. Thank you.

  • @sweathajeyaprakash1814
    @sweathajeyaprakash1814 Před 3 lety +1

    Great explanation really It made my day Thanks Neil!!!

  • @piratevv
    @piratevv Před 3 lety +2

    excellent explanation!!

  • @noaht9184
    @noaht9184 Před 9 měsíci

    You are an absolute legend.

  • @hoangdz6558
    @hoangdz6558 Před 10 měsíci

    What happens if the shared page is initially unwritable? When you write on copy, how does the OS know when to update writable from false -> true or not?

    • @hoangdz6558
      @hoangdz6558 Před 10 měsíci

      I mean, the parent page is unwritable even before the fork, hence, after the child make attempt to write, how does it know that the false value of writable is due to the sharing among pages or due to the read-only?

  • @D0ct0rPepper
    @D0ct0rPepper Před rokem

    Thank you!

  • @AFPinerosG
    @AFPinerosG Před 3 lety

    I have a question. Let's assume the parent process has a single memory page to simplify the question. Let's say the parent process forkes 4 children. This means that the refCount for the memory page is 5, right?
    If only one of the processes (let's call it process X) tries to update the memory page, is it:
    A) Going to create a copy of the page ONLY for Process X and reduce the refCount to 4. Or
    B) going to create 5 copies of the memory page?
    Another question:
    In your example, with the two processes, if the parent process is the one that triggers the write on the shared memory page, is the new cloned page going to be assigned to the parent or to the child? I think the clone would be assigned to the process that changed the memory values and the original would be left for the processes that didn't change it yet, right?
    Thanks!

    • @NeilRhodesHMC
      @NeilRhodesHMC  Před 3 lety

      If parent process forks 4 children, yes, the refcount for the memory page is 5. If any one tries to update the page, it'll create a copy only for itself. Every other process will need to make its own copy if it ever tries to modify the page.
      For the second question: whoever does the write is going to copy the page to a new page.

  • @Mrzappetta1
    @Mrzappetta1 Před 2 lety

    Thanks for the video and the nice explanation, i'd like to ask, what happens if child does another cow fork ?

    • @NeilRhodesHMC
      @NeilRhodesHMC  Před 2 lety

      It'll work fine. OS will need to keep track of how many processes have a page copy-on-write'd.

  • @liangkevin9960
    @liangkevin9960 Před 2 lety

    Nice explanation, just have one question, so if the parent process needs to do some changes on Page 1, which due to copy-on-write, the PTE is read-only, then it will the scenario as above right?

    • @NeilRhodesHMC
      @NeilRhodesHMC  Před 2 lety +2

      If either the parent process *or* the child process tries to make changes to page 1, it'll do a copy-on-write (because the PTE will be marked read-only).

    • @liangkevin9960
      @liangkevin9960 Před 2 lety

      @@NeilRhodesHMC Thanks