diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 564e5c6cd5cd..4d1499a9264b 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1068,7 +1068,9 @@ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry) /* * Enter it in the pmap... */ + vm_page_lock_queues(); vm_page_flag_clear(dst_m, PG_ZERO); + vm_page_unlock_queues(); pmap_enter(dst_map->pmap, vaddr, dst_m, prot, FALSE); vm_page_lock_queues(); vm_page_flag_set(dst_m, PG_WRITEABLE); diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f72bc32d732e..ac32d690e8de 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -401,8 +401,10 @@ kmem_malloc(map, size, flags) } if (flags & M_ZERO && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); + vm_page_lock_queues(); vm_page_flag_clear(m, PG_ZERO); m->valid = VM_PAGE_BITS_ALL; + vm_page_unlock_queues(); } vm_object_unlock(kmem_object);