linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* hard question re: swap cache
@ 2003-05-27 21:41 Carl Spalletta
  2003-05-28  0:08 ` Hugh Dickins
  2003-05-28 14:53 ` Dave McCracken
  0 siblings, 2 replies; 5+ messages in thread
From: Carl Spalletta @ 2003-05-27 21:41 UTC (permalink / raw)
  To: linux-mm

Assume a shared, anonymous page is referenced by a set of
processes a,b,c,d,e and the page is marked present in the
page tables of each process.  Assume then that the page is
marked for swapout in the pagetables of 'a'. A swap slot is
filled with a copy of the page, but it is still present in
memory. As I understand it, it may still possible for b,c,d,e
to modify the page (since it is shared) and this is no problem
since there is no need to co-ordinate with the swapped out
page while the page usage counter is positive(if the system
decides to make the page present for a, it should simply
decrement the page slot counter but not bother with swapping
back since the page in memory is either an exact duplicate
or is newer than what is in the swap slot).

Then say b,c,d and e in that order have the page swapped out.
Either the page is copied to the page slot for each swapout
or it _must_ be copied on the last swap (when the page usage
counter goes to zero) else the modifications made by b,c,d,e
will be lost.

I can't decide which method is used and I can't find where in
the 2.5 code it occurs - can anyone help?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: hard question re: swap cache
@ 2003-05-27 23:04 Carl Spalletta
  2003-05-28 10:01 ` Sean Neakums
  0 siblings, 1 reply; 5+ messages in thread
From: Carl Spalletta @ 2003-05-27 23:04 UTC (permalink / raw)
  To: linux-mm

I thought of a simple example. Suppose processes a,b,c
have a shared, anonymous page.  All processes have this page
present.  Then the page for a is swapped out.  Then b and c
exit unexpectedly, after making changes to the page.  When
and if 'a' has the page swapped back in, what mechanism
guarantees that it will see the changes made by b and c?
Where specifically in the code, in what functions, does it
reside for kernel 2.5?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

end of thread, other threads:[~2003-05-28 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-27 21:41 hard question re: swap cache Carl Spalletta
2003-05-28  0:08 ` Hugh Dickins
2003-05-28 14:53 ` Dave McCracken
2003-05-27 23:04 Carl Spalletta
2003-05-28 10:01 ` Sean Neakums

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox