Sure I agree, but I’m still having trouble with Max saying:
"When a PTE is made valid, the reference count for the page table containing
the PTE is incremented. And vice versa. "
The reference on the Page Table might or might not be OS MM policy, but he
is saying here, unless I’m misreading, that the reference count on the PTE
is also incremented, and that would make all PTE’s effectively non-pageable.
-----Original Message-----
From: xxxxx@rdperf.com [mailto:xxxxx@rdperf.com]
Sent: Monday, April 03, 2000 11:13 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Are page tables paged out?
Please forgive any errors in this description. It has been a long
time since I studied this and I am doing this off the top of my head.
Page table entries are hardware dependent. In fact, it would
be possible
(I think MIPS is this way) to NOT have a hardware PTE. The hardware
implementations that I have looked at tdo not have “reference counts”
in the PTEs. They would effectively be meaningless. They
would have a “valid”
bit as well as some kind of “dirty” bit to indicate that
there was a recent
write to the page so that page cleanup can make sure that
section files
get written out to the disk before pages are removed.
The reference count referred to is probably the one in the Page Frame
Database. This reference count is used to “lock” down pages. The PFN
database is an OS construct and has NOTHING to do with the hardware
except that it helps the OS track physical memory pages. By
OS definition,
a page with a non-zero reference count in it’s PFN database
entry is NOT
pageable. This is essentially how MmProbeAndLockPages locks pages.
It’s a different mechanism, but similar that is used to lock
pages within
a working set. A process has a working set list that works
in a similar
manner to the PFN database to provide for working set trimming.
I would imagine that what Max was saying is that when a page
mapped by a
PTE is paged in, the reference count for the page containing
the PTE gets
incremented to prevent it’s being paged. I am not certain
that this happens,
but it certainly makes sense. In theory, however, there
would be no reason
why an OS couldn’t choose to page PTE pages without paging
the pages that
they map. It wouldn’t make sense to do this since a page fault would
need to be rendered the next time a reference happened.
Therefore, it makes
sense to only page out a PTE page when all the pages it maps
are paged out.
I suppose that if you had some pages mapped by a PTE that were locked
(probably for a DMA transfer), you might decide to page the PTE page
since ALL the pages it maps cannot be paged. I wouldn’t even
be surprised
if that happens in the case of a severe memory resource
crisis. It certainly
would be okay in theory to do.
just my opinion based aon a potentially faulty recall
mechanism. The old
brain is not quite what it used to be.
Rick Cadruvi…
>All right, color me stupid, but why is it exactly that a
page cannot be
>paged out if its reference count is not zero? Wouldn’t the
reference count
>be the number of valid references to this particular
virtual->physical
>mapping? Wouldn’t a zero count indicate that the particular
mapping, if it
>is pageable, should be discarded? I thought, and perhaps I
am very mistaken
>here, that pageable virtual->physical mappings can always be
paged out as
>long as they are not explicitly ‘pinned down’, as in
MmProbeAndLockPages.
>
>> -----Original Message-----
>> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
>> Sent: Monday, April 03, 2000 3:42 AM
>> To: NT Developers Interest List
>> Subject: [ntdev] Re: Are page tables paged out?
>>
>>
>> > Really? So in other words, a page in the page table can
>> only be paged out
>> > if all of the pages that it describes have been paged out
>> themselves?
>> i.e.
>> > the page tables are the last thing to get paged out?
>>
>> Certainly. And can you imagine any other ways of pageable
page tables?
>> When a PTE is made valid, the reference count for the page
>> table containing
>> the PTE is incremented. And vice versa. Page can be swapped
>> out only if
>> refcount == 0.
>>
>> Max
>>
>>
>>
>> —
>> You are currently subscribed to ntdev as: xxxxx@stratus.com
>> To unsubscribe send a blank email to
$subst(‘Email.Unsub’)
>>
>
>—
>You are currently subscribed to ntdev as: xxxxx@rdperf.com
>To unsubscribe send a blank email to $subst(‘Email.Unsub’)
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)