So from algorithm description, we go to implementation
now. This is where rubber meets the road
in systems reset. In any good systems reset,
the prescription is as follows. You identify a
pain point. Once you identify the pain point. You think of what may be a clever
solution to that. Then a lot of heavy
lifting actually happens in taking that solution, which may
be a very simple solution, but implementing that is the hard part. if you take
this particular lesson that we're looking at The
solution idea is fairly simple. The idea is
that instead of using the disk as a
paging device, use the cluster memory. But implementing
that idea requires quite a bit of heavy
lifting, and one might say that in systems
research these technical details Of taking an
idea and working out the technical details
of implementing that idea is probably the
most important nugget. Even if the idea
itself is not enduring, the implementation tricks
and techniques that are invented in order
to do their implementation of their idea
maybe reusable knowledge for other systems research.
So that's a key takeaway in any systems research and this true for this one as
well. Now in this particular case, the authors
of GSM used a deck, little equipment corporations operating
system as the base system. The operating system
is called OS of 1 operating system. And
there are two key components. In the OSF1
memory system, which is what we're talking about here.
The first one is the virtual memory system,
and this is the one that is responsible
for mapping process virtual address space to physical
memory, and worrying about page faults that happen when
a process is trying to access the stack and heap and so on. So that it can
bring those missing pages perhaps from the disk.
And these pages are sometimes referred to as anonymous
pages because a page is housed in a physical page frame and when a page is
replaced, that same physical page frame may host
some other virtual page and so on. So
the virtual memory system is devoted to managing
the page faults that occur for process virtual
address space, in particular the stack and the
heap. And the unified buffer cache is the cache
that is used by the file system. And remember
the file system is also getting stuff from the
disk. But the other system wants to cache it
in physical memories so that it is faster, so the
unified buffer cash is serving as the extraction for
the disk resident files when it gets into physical
memory and user processes. Are going to do explicit
access to files. When they do that, they're actually accessing
unified buffer cache. So reads and writes of files
go to this unified buffer cache. In addition to
that, Unix systems offer the ability to map a
file. Into memory, which is called memory mapped files.
And if you have a memory mapped file, you
can also have page faults to a file that
has been mapped into memory. So the unified buffer
cache is responsible for handling page faults to map files,
as well as explicit read and write calls.
That an application process may make to the file
system. So normally this is the picture of how
the memory system hangs together in any typical implementation
of an operating system. You have the virtual memory
manager, you have the unified buffer cache, you have
the disk, and region writes from the virtual memory
manager go to the disk, and similarly reads and
writes from the unified buffer cache, go to the
disk and when a physical page frame is freed, you
through it into the free list. So that it
is available for future use by either the virtual memory
manager or the unified buffer cache. And the Pageout
Daemon, it's role is to look at every once in
a while what are pages that can be swapped out
to the disk so that you make room for page
faults to be handled without necessarily running an
algorithm to free up pages. so that's the structure
of a memory management system, and what the
authors of GMS did, was to integrate GMS into
the operating system, and this is where I
said that. There is heavy lifting to be done,
because you are modifying the operating system to integrate
an idea that you had for global memory system.