a question on mapping from PTE to swap entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

It's quoted that "When a page is swapped out, Linux uses the correspondingPTE to store enough 
information to locate the page on disk again".

I'm curious when multiple process has the same PTE which points to the samepage, 
how can kernel differenciate which page from swap space should be swappedin?

For example, there are 3 processes, each of them has a virtual page that is mapped to a 
phyisical page PAGE_A, that means the same PTE is mapped to same PAGE

Process 1 runs out of its  timeslice
Process 2 get scheduled, PAGE_A was from Process 1, so it should be swapped out
Process 3 get scheduled, PAGE_A was from Process 2, so it should be swapped out
Process 1 now comes back, 

when he use PTE to look for its PAGE_A, it will get two PAGE_A,
one is from itself, and the other from Process 2

How does kernel handle this situation?

Thanks
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux