Hold the page queues lock when performing vm_page_flag_set().

This commit is contained in:
Alan Cox 2002-12-17 19:55:28 +00:00
parent 77b653d95d
commit d8e7c54e1e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107989
2 changed files with 3 additions and 1 deletions

View File

@ -145,9 +145,9 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
for (i = 0; i < count; i++) {
if ((m[i]->flags & PG_ZERO) == 0)
pmap_zero_page(m[i]);
vm_page_flag_set(m[i], PG_ZERO);
/* Switch off pv_entries */
vm_page_lock_queues();
vm_page_flag_set(m[i], PG_ZERO);
vm_page_unmanage(m[i]);
vm_page_unlock_queues();
m[i]->valid = VM_PAGE_BITS_ALL;

View File

@ -433,7 +433,9 @@ kmem_malloc(map, size, flags)
* Because this is kernel_pmap, this call will not block.
*/
pmap_enter(kernel_pmap, addr + i, m, VM_PROT_ALL, 1);
vm_page_lock_queues();
vm_page_flag_set(m, PG_WRITEABLE | PG_REFERENCED);
vm_page_unlock_queues();
}
vm_map_unlock(map);