aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2009-07-18 01:50:05 +0000
committerAlan Cox <alc@FreeBSD.org>2009-07-18 01:50:05 +0000
commit13de72215557c2b1487f7fd932d3569975d1d1bf (patch)
tree3735260e5ee08da379a2641b39b41827e7347d4d /sys/vm/vm_page.c
parentb2da7746233a60a51aa38b40a79958a45eddf496 (diff)
downloadsrc-13de72215557c2b1487f7fd932d3569975d1d1bf.tar.gz
src-13de72215557c2b1487f7fd932d3569975d1d1bf.zip
An addendum to r195649, "Add support to the virtual memory system for
configuring machine-dependent memory attributes...": Don't set the memory attribute for a "real" page that is allocated to a device object in vm_page_alloc(). It is a pointless act, because the device pager replaces this "real" page with a "fake" page and sets the memory attribute on that "fake" page. Eliminate pointless code from pmap_cache_bits() on amd64. Employ the "Self Snoop" feature supported by some x86 processors to avoid cache flushes in the pmap. Approved by: re (kib)
Notes
Notes: svn path=/head/; revision=195749
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index b9c4ebc74ae1..d8d74c04023e 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1161,7 +1161,9 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
mtx_unlock(&vm_page_queue_free_mtx);
if (object != NULL) {
- if (object->memattr != VM_MEMATTR_DEFAULT)
+ /* Ignore device objects; the pager sets "memattr" for them. */
+ if (object->memattr != VM_MEMATTR_DEFAULT &&
+ object->type != OBJT_DEVICE)
pmap_page_set_memattr(m, object->memattr);
vm_page_insert(m, object, pindex);
} else