From e16cfdbea47bc0c7d83898d1747bbb795d7fe36f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 14 Jul 2002 19:36:15 +0000 Subject: [PATCH] o Lock page queue accesses by vm_page_wire(). --- sys/vm/vm_glue.c | 2 ++ sys/vm/vm_kern.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 870bced9c19f..cf37e4675eb0 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -328,12 +328,14 @@ vm_proc_swapin(struct proc *p) } if (upobj->resident_page_count != UAREA_PAGES) panic("vm_proc_swapin: lost pages from upobj"); + vm_page_lock_queues(); TAILQ_FOREACH(m, &upobj->memq, listq) { m->valid = VM_PAGE_BITS_ALL; vm_page_wire(m); vm_page_wakeup(m); vm_page_flag_set(m, PG_MAPPED | PG_WRITEABLE); } + vm_page_unlock_queues(); up = (vm_offset_t)p->p_uarea; pmap_qenter(up, ma, UAREA_PAGES); } diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index c3a1312ff1f1..2377355cdd83 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -419,8 +419,10 @@ kmem_malloc(map, size, flags) */ for (i = 0; i < size; i += PAGE_SIZE) { m = vm_page_lookup(kmem_object, OFF_TO_IDX(offset + i)); + vm_page_lock_queues(); vm_page_wire(m); vm_page_wakeup(m); + vm_page_unlock_queues(); /* * Because this is kernel_pmap, this call will not block. */