Clustering - what exactly happens there?

I’ve run a few tests in order to determine the clustering behavior of
Windows NT.
For all my test programs, the cluster size was 32k (meaning, instead of
getting a 4k page it got 8 pages = 4*8 = 32k).
I tired to trick the Operating System into getting less then 32k, but I
wasn’t successful.
At first I thought that the REAL required page was the first in the
cluster, but I found this wasn’t true…
So how does the Virtual Memory Manager determine the cluster offset?
Meaning, it certainly doesn’t create the cluster offset beginning from the
required page (meaning the first page in the cluster is the REALLY required
one) - but rather - as my test showed - it uses some other method.
Where can I read more about this?

Many thanks, Alon.

> Meaning, it certainly doesn’t create the cluster offset beginning from the

required page (meaning the first page in the cluster is the REALLY
required
one) - but rather - as my test showed - it uses some other method.

In some cases (don’t remember what) MM uses forward clustering only.
But usually it scans the prototype PTE table (the segment) back and forth
from the given prototype PTE till it will find the first present prototype
PTE.
An array of non-present prototype PTEs is created by this operation - this
is
the cluster.
Note that MM never crosses the page boundary in the segment - so, all
prototype PTEs in the cluster reside in the same page.

Max