Say you have a driver that needs to manage many small structures of
fixed size such that the driver may have several megabytes worth of these
structures allocated at any given time from paged pool. Since the
structures are allocated from paged pool, I can imagine that it would be
beneficial to allocate the structures from a contiguous heap of memory to
preserve 'locality of reference': one page fault will bring in tens or
hundreds of these structures reducing overall paging of the system as these
structures are accessed.
Is it worth the effort of doing some of your own memory management
or will the VMM do an adequate job of preserving this locality of reference
(or does it even try)? Looking at the DDK documentation, it seems that
'zones' were designed to address this issue, however, they have been
declared obsolete. The documentation suggests 'lookaside lists', although
lookaside lists seem to address a different need than did zones; lookaside
lists seem not to be designed to reduce fragmentation and preserve locality
of reference as I've described.
So, Will lookaside lists help here? Should I use zones to reduce
fragmentation? Or should I just assume the VMM will do some work to help
out with fragmentation? Any suggestions?
BTW are there any guidelines as to how much address space a well
mannered driver should consume? Given that I'm sharing my 2GB with everyon
else now (and just a fraction of that for the pools), I'm wondering how much
is too much. Is several megabytes of of paged pool too much? I figure if
its there, I may as well use it - but that's coming from the perspective of
a user mode developer!