On Wed, 21 Mar 2001, Matt Dillon wrote:

>     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;

The (maybe too lightweight) structure I have in my patch
looks like this:

struct pte_chain {
        struct pte_chain * next;
        pte_t * ptep;
};

Each pte_chain hangs off a page of physical memory and the
ptep is a pointer to a page table entry.

The page struct of the page table page itself is used to
note down which address space and offset we have. This means
that FreeBSD's pv_pmap, pv_va and pv_ptem are in the page
table page and NOT in each pte_chain structure...

The only issue is address space rundowns, but this _could_
be ok due to the fact that systems usually seem to have more
short-running processes than long-running ones and the tasks
that are short-running will have their pte_chain nearer to
the beginning of the list.

Finding all pages in an address_space is simply done by walking
the populated parts of the page tables, this is cache friendly
and relatively fast for everything except really huge sparse
mappings (but in that case, the finer grained locking makes sure
this penalty gets restricted to the exiting task only and doesn't
block the rest of the system).

The whole patch is available at:
  http://www.surriel.com/patches/2.4/2.4.1-pmap-swapsonuml

I have some newer code available, but haven't bothered coding
up a new patch yet since the reverse mapping is experimental
stuff and we're still busy finetuning and debugging 2.4 ;)

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

                http://www.surriel.com/
http://www.conectiva.com/       http://distro.conectiva.com.br/


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

Reply via email to