In article <m0xbs4b-0005FtC@lightning.swansea.linux.org.uk> you write:
>> It's probably very much worth it. You really have two situations to
>> consider. Small memory machines and large memory machines. On small memory
>> machines this structure would shrink to a smaller size and have less impact.
>Well the cost will be probably be 3bytes/page on a 32bit machine (the lowest
>12 bits are fixed on a 4K page machine, lowest 13 on 8K etc). That means
>you've actually got room for at least 4 flag bits.
>(Multiply by 3 may seem worse than shift left 2 but you dont hit the table
>that often and its actually a shift and add.)
The corresponding structure in the 4.4BSD vm is a bit more complicated:
* It has 3 pointers for linked lists:
- page queue (free list or active/inactive queue)
- hash table link (hash table mapping from object/offset to the
corresponding physical page)
- object page list (linked list of all physical pages allocated to the
same VM object, for efficiently freeing pages belonging to an object
currently being deallocated)
* (object,offset) information, mapping the physical page back
to the VM object it belongs to and the offset therein.
* wire count (a reference count, but counting only references that require
the page to be wired, i.e. not pageable)
* flags
* physical address
accounting for a total of 28 bytes on 32 bit machines, or an overhead of
0.68 percent of the free memory after kernel initialization.
Hope that helps a bit.
Regards, Felix.