[Autogenerated] let's now discuss working set and how
physical memory is managed by the kernel in an efficient way
to try to minimize hard page faults.
A working set in general is referring to RAM or to be more precise
memory that doesn't cause a page fault to occur.
Every process has its own working set,
that's the subset of the committed memory of the process where
accessing it will not cause a page fault.
Obviously in an ideal world,
all the memory that is committed in the process would be in RAM
and would be accessed without any page fault.
But of course this is just an ideal world.
In the real world,
some memory might be paged out so every process has its own working set.
The system also has its own working set which represents all
the working set or memory that is currently in physical memory
or access without a page fault,
which is related to kernel components and kernel device driver,
so just like with processes, kernel memory also,
most of it is non pay is payable, just like any other memory,
although it does have a non page aspect to that,
which we'll discuss in the next module,
but at least the colonel is just like anyone else wants to use RAM and it has to
deal with the fact that not all memories in RAM at all times and so whenever
some data or code has to be read from from a file,
then the system reads a little bit more than what is actually needed in order
to reduce our operations that caching has a better effect now in order to
manage everything that's going on in terms of RAM,
the memory manager is managing this thing called the page
frame number database or PFM database It describes the
state of all physical pages.
A physical page could be free.
A physical page could belong to one process.
Maybe some private memory,
a physical page might be shared between multiple processes.
For example, some DLL code is in that page,
anything can happen here and so the colonel has to maintain
all that information when thinking about P.
T.
S as we've seen earlier.
The actual PFM number is there pointing to that um
particular page frame number providing details as to what
that page in physical memory is used for.
So for every physical page in that exists on the system,
there's a small data structure describing it.
So a P F.
N points back to P.
T.
At least the PFM for some private memory.
And in general,
the PFM data structure is dynamic in the sense that it
looks different based on the actual page,
what that page is used for right now, whether it's shared or not free or not.
I'm not going to show the entire verse creations here.
You can find them in the Windows internals book.
What I want to talk about here is how these physical pages are
managed so that the kernel tries to minimize hard page fault
and if there are any page faults, let them be soft page faults.