Hello everyone,


I can understand hard page fault is we need to load from page file into
working set (RAM). But what is a soft page fault? I am confused.


thanks in advance,
George

Re: page fault by Igor

Igor
Thu Jan 10 08:03:41 CST 2008

"George" <George@discussions.microsoft.com> wrote in message
news:F975E3F1-F47E-4F1F-AE66-4D5A3D7D9483@microsoft.com
> I can understand hard page fault is we need to load from page file
> into working set (RAM). But what is a soft page fault? I am confused.

I found this in my copy of January 2006 MSDN. This article doesn't seem
to be in MSDN Online. See if this helps.

<quote>
page fault

In the processor, a page fault occurs when a process refers to a virtual
memory page that is not in its working set in main memory.

A hard page fault occurs when data that a program needs is not found in
its working set (the physical memory visible to the program) or
elsewhere in physical memory, and must be retrieved from disk.

A page fault will not cause the page to be fetched from disk if that
page is on the standby list, and hence already in main memory, or if it
is in use by another process with which the page is shared. In this
case, a soft page fault occurs.
</quote>

For example, if you load a DLL that is already loaded and in use by
another process, the DLL's code doesn't need to be retrieved from disk
as it's already in memory. Physical memory pages holding the code just
need to be mapped into your process' address space. That's what soft
page fault does.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: page fault by George

George
Thu Jan 10 08:15:02 CST 2008

Great Igor!


My question is answered.

Here is some information I found from MSDN which describes soft page fault
when re-loading page from standby list.

http://support.microsoft.com/kb/108449/en-us

--------------------
Process pages that are paged out of your process space are moved into the
"standby list," where they remain until sufficient free RAM is available, or
until system memory is low and they need to be reused. If these pages are
accessed by your process while they are still on the standby list and more
RAM has become available, they will be "soft-faulted" back into the working
set. This does not require any disk access, so it is very quick. Therefore,
even though you have an upper limit to the size of your working set, you can
still have quite a few process pages in memory that can be pulled back into
your working set very quickly.
--------------------


regards,
George

"Igor Tandetnik" wrote:

> "George" <George@discussions.microsoft.com> wrote in message
> news:F975E3F1-F47E-4F1F-AE66-4D5A3D7D9483@microsoft.com
> > I can understand hard page fault is we need to load from page file
> > into working set (RAM). But what is a soft page fault? I am confused.
>
> I found this in my copy of January 2006 MSDN. This article doesn't seem
> to be in MSDN Online. See if this helps.
>
> <quote>
> page fault
>
> In the processor, a page fault occurs when a process refers to a virtual
> memory page that is not in its working set in main memory.
>
> A hard page fault occurs when data that a program needs is not found in
> its working set (the physical memory visible to the program) or
> elsewhere in physical memory, and must be retrieved from disk.
>
> A page fault will not cause the page to be fetched from disk if that
> page is on the standby list, and hence already in main memory, or if it
> is in use by another process with which the page is shared. In this
> case, a soft page fault occurs.
> </quote>
>
> For example, if you load a DLL that is already loaded and in use by
> another process, the DLL's code doesn't need to be retrieved from disk
> as it's already in memory. Physical memory pages holding the code just
> need to be mapped into your process' address space. That's what soft
> page fault does.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>