So far the cases that we considered are
cases in which a page that we are faulting
on is private to a process. So let's consider
the case where a page is actively shared. That
means that two hosts P and Q, and both of them are actively sharing a page X,
and currently some processes on host Q, is using
that page X so, is in the local part
in the working set portion of host Q. And host
P, the process is page faulting on the same page X.
So when a page faults, GMS says, oh, let me find
out what it is. Well, it finds that x is in
the local part of host Q and because it is
in the current working set of host Q. We want to leave
it there. We don't want to yank it away from there. We
want to leave it there. We want to make a copy of
this page into the local part of host p so that the faulting process on host p
will have access to the page x. Again,
we have the same situation that the working set
on host p is increasing. The local part
has to allocate one more page. In physical memory
for the active working set for the processes
on B, so the global part has to shrink
by one. So, this goes up by one, this goes down
by one. Pick again some arbitrary page from the global part.
It doesn't have to be the LRE page, because all, all
that your going to do is you're going to put this into the
peer memory somewhere. So in that sense, what we are doing
is we're going to say well, take this y and host in
some of the peer cache. So what are we, who are
we going to send it to? Well, we're going to send it to
the host R that happens to have. The
globally oldest page. Remember that in this situation, the
total memory pressure of the entire cluster is going
up by one, not just this guy, because x
is going to be still present in the working
set of host Q, and x is also going to
be present in the working set of host P.
Which means the total memory impression in the entire
cluster is going up by 1. And that is
the case, then I have to necessarily pick a
page from the entire cluster and throw it all
under the desk, and that's what we're doing here. What
we are saying is that host R happens to
have the globally host stage, and this page that I
am replacing from host P in order to accommodate
The missing page and bring it into my local cache
on host P is to throw out why over to host R and host R in order to
make room for this guy in it's global cache
has to necesarily pick a victim from it's physical memory
and the victim it picks is going to be The
LRU candidate, and that could come from the Local part
or from the Global part. Again, if it comes
from the Global part, we know it's private and we
throw it away. if it comes from the Local part,
it could be that this is a dirty copy, in
which case we have to write all to the disc,
or drop it on the floor if it is a clean
copy because the disc always has. All the copies of the pages. In either case
the important message is that if the LRU candidate that we're going to throw
out onto the disc our drop on the floor comes from the local part
of R. That means similar to the previous case, the working set on local R is
shrinking. Is coming down by one. Which means
are, host are, can do more community service
in the future. And now the x is present in the working set of both host Q
and host P which means actively some processor on host P, some process on host Q
are accessing this page X. I mentioned earlier
that this is not something that GSM worries
about. If coherence is to be maintained for
the copies of the same page existing on
multiple nodes, that's not in the domain of
GSM because GSM is simply a paging device.
So it doesn't worry about coherence maintenance. There
has to be something that the application or
some higher level of the software has to worry
about. So we can talk about the relative split between
local and global. In this particular case, well, in
this case host P local goes up by one, global
goes down by one. In host Q Nothing changes
because there is an actively shared page which may relieve
the copy here, just give a copy over to
P, so the balance between local and global doesn't change.
On the other hand in host R if
the replacement candidate came out of The global part,
then then there is no change in the
split between local and global and host R either.
On the other hand, if the replacement candidate
came from the local cache of host R, what
that means is that the working set, memory
pressure on host R is decreasing. And therefore L
will go down by one and G will go up by one. I want you to think through
all these four cases very carefully. The first three
cases that we looked at were cases in which the
pages were all private. And this is the only
case where the page is potentially shared because it is
in the [INAUDIBLE] It is in the local cache
of Host Q and in the local cache of Host
P as well, and now it is time for a quiz.