kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* a question on mapping from PTE to swap entry
@ 2018-11-15 15:53 Larry
  2018-11-15 15:53 ` Larry
  2018-11-15 17:59 ` valdis.kletnieks at vt.edu
  0 siblings, 2 replies; 4+ messages in thread
From: Larry @ 2018-11-15 15:53 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-15 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 15:53 a question on mapping from PTE to swap entry Larry
2018-11-15 15:53 ` Larry
2018-11-15 17:59 ` valdis.kletnieks at vt.edu
2018-11-15 17:59   ` valdis.kletnieks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).