]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFamd64/i386
authorAlan Cox <alc@FreeBSD.org>
Mon, 20 Apr 2009 03:44:54 +0000 (03:44 +0000)
committerAlan Cox <alc@FreeBSD.org>
Mon, 20 Apr 2009 03:44:54 +0000 (03:44 +0000)
commit1c951556bc51f07f68c6ffb45e6655ad41c7e9a1
tree25e309a2089071841bbb53606fc2781c6a6cd806
parent472dfd2aebb001c4bfa53f2ff3e0fd087510825c
MFamd64/i386
  Introduce pmap_try_insert_pv_entry(), a function that conditionally
  creates a pv entry if the number of entries is below the high water mark
  for pv entries.

  Introduce pmap_enter_quick_locked() and use it to reimplement
  pmap_enter_object().  The old implementation was broken.  For example,
  it could block while holding a mutex lock.

  Change pmap_enter_quick_locked() to fail rather than wait if it is
  unable to allocate a page table page.  This prevents a race between
  pmap_enter_object() and the page daemon.  Specifically, an inactive
  page that is a successor to the page that was given to
  pmap_enter_quick_locked() might become a cache page while
  pmap_enter_quick_locked() waits and later pmap_enter_object() maps
  the cache page violating the invariant that cache pages are never
  mapped.  Similarly, change
  pmap_enter_quick_locked() to call pmap_try_insert_pv_entry() rather
  than pmap_insert_entry().  Generally speaking,
  pmap_enter_quick_locked() is used to create speculative mappings.  So,
  it should not try hard to allocate memory if free memory is scarce.

Tested by: gonzo
sys/mips/mips/pmap.c