:* Rik van Riel <[EMAIL PROTECTED]> [010321 09:51] wrote:
:> On Wed, 21 Mar 2001, Peter Wemm wrote:
:> 
:> > Also, 4MB = 1024 pages, at 28 bytes per mapping == 28k per process.
:> 
:> 28 bytes/mapping is a LOT.  I've implemented an (admittedly
:> not completely architecture-independent) reverse mapping
:> patch for Linux with an overhead of 8 bytes/pte...
:> 
:> I wonder how hard/easy would it be to reduce the memory
:> overhead of some of these old Mach data structures in FreeBSD...
:
:"Our" Alan Cox <[EMAIL PROTECTED]> and Tor Egge have been trimming
:these structs down for quite some time.  Perhaps they should
:look at Linux's system, however last I checked Linux's was
:an order of magnitude less complex which might prohibit that
:simplification in FreeBSD.
:
:If you have suggestions, let's hear them. :)
:
:-- 
:-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]

    We've looked at those structures quite a bit.  DG and I talked about
    it a year or two ago but we came to the conclusion that the extra
    linkages in our pv_entry gave us significant performance benefits
    during rundowns.  Since then Tor has done a lot of cleanup, but
    I don't think the analysis has changed much.

typedef struct pv_entry {
        pmap_t          pv_pmap;        /* pmap where mapping lies */
        vm_offset_t     pv_va;          /* virtual address for mapping */
        TAILQ_ENTRY(pv_entry)   pv_list;
        TAILQ_ENTRY(pv_entry)   pv_plist;
        vm_page_t       pv_ptem;        /* VM page for pte */
} *pv_entry_t;

    pv_pmap

        The pmap associated with the pv_entry.

    pv_va

        The virtual address of the pv_entry in the pmap.  Used to quickly
        track down the pv_entry associated with a (pmap, vm_page_t, va)
        when iterating a pv_list or pv_plist.

    pv_list     - pv_entry's associated with a vm_page_t. 
    pv_plist    - pv_entry's associated with a pmap

        A pmap_entry can be located either through pv_list or through
        pv_plist.  The kernel chooses which list to iterate through to
        find a pv_entry based on which of the two lists has the least number
        of elements.  One of the two nodes could be removed from the pv_entry
        structure (saving 8 bytes) could be removed but at the cost of
        performance for certain cases.

        If you have a huge number of processes sharing a page of
        memory, iterating through pv_plist to locate a mapping is
        usually more efficient.  If you have fewer processes but full
        mappings (e.g. the page table page is full), then iterating
        through pv_list is more efficient.

    pv_ptem

        The vm_page_t associated with a pv_entry.  This field is used
        to quickly find associate vm_page_t's when we are wiping
        whole page tables (e.g. on process exit).  It could be 
        removed, but at significant cost to process exits and 
        munmap()'s of large areas.


    Theoretically we can remove half the structure, but at a
    significant cost in performance.

                                                -Matt



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to