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

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • Day # of Harvey Mudd College Operating Systems class

ความคิดเห็น • 24

  • @AFPinerosG
    @AFPinerosG 3 ปีที่แล้ว +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  3 ปีที่แล้ว +1

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

    • @marone6611
      @marone6611 ปีที่แล้ว

      there's no such thing as visual learning

  • @Joe4740
    @Joe4740 3 ปีที่แล้ว +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!

    • @neilrhodes4355
      @neilrhodes4355 3 ปีที่แล้ว

      So glad it was useful.

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 ปีที่แล้ว +1

      @@neilrhodes4355 Glad to hear it trumped watching a TV show:)

  • @waltersmuts649
    @waltersmuts649 3 ปีที่แล้ว +4

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

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 ปีที่แล้ว

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

  • @YashVerma-n6o
    @YashVerma-n6o 17 วันที่ผ่านมา

    Huge respect sir.

  • @sweathajeyaprakash1814
    @sweathajeyaprakash1814 3 ปีที่แล้ว +1

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

  • @piratevv
    @piratevv 3 ปีที่แล้ว +2

    excellent explanation!!

  • @noaht9184
    @noaht9184 9 หลายเดือนก่อน

    You are an absolute legend.

  • @kidou123456
    @kidou123456 14 ชั่วโมงที่ผ่านมา

    I cannot believe I found this hidden gem channel till now! Thank you for the clear and concise walkthrough of a plethora of CS topics, Mr. Rhodes! Watching them feels like ASMR!

  • @D0ct0rPepper
    @D0ct0rPepper ปีที่แล้ว

    Thank you!

  • @hoangdz6558
    @hoangdz6558 10 หลายเดือนก่อน

    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 10 หลายเดือนก่อน

      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?

  • @AFPinerosG
    @AFPinerosG 3 ปีที่แล้ว

    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  3 ปีที่แล้ว

      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 2 ปีที่แล้ว

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

    • @NeilRhodesHMC
      @NeilRhodesHMC  2 ปีที่แล้ว

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

  • @liangkevin9960
    @liangkevin9960 3 ปีที่แล้ว

    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  3 ปีที่แล้ว +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 3 ปีที่แล้ว

      @@NeilRhodesHMC Thanks

  • @frankwu9653
    @frankwu9653 10 หลายเดือนก่อน

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