diff options
author | alc <alc@FreeBSD.org> | 2006-04-25 17:27:24 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-04-25 17:27:24 +0000 |
commit | 67908520ecd19cc46d126444d903796728b5e697 (patch) | |
tree | 3e3cea526227d46454e4a7b05672120375c6088c /sys/vm | |
parent | 0ba8cb55520811b4df6c227ee8f29d3a9f531c0f (diff) | |
download | FreeBSD-src-67908520ecd19cc46d126444d903796728b5e697.zip FreeBSD-src-67908520ecd19cc46d126444d903796728b5e697.tar.gz |
Add synchronization to vm_pageq_add_new_page() so that it can be called
safely after kernel initialization. Remove GIANT_REQUIRED.
MFC after: 6 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_pageq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_pageq.c b/sys/vm/vm_pageq.c index 7d8bead..8f03704 100644 --- a/sys/vm/vm_pageq.c +++ b/sys/vm/vm_pageq.c @@ -195,8 +195,6 @@ vm_pageq_add_new_page(vm_paddr_t pa) vm_page_t m; char *cp, *list, *pos; - GIANT_REQUIRED; - /* * See if a physical address in this page has been listed * in the blacklist tunable. Entries in the tunable are @@ -225,13 +223,15 @@ vm_pageq_add_new_page(vm_paddr_t pa) freeenv(list); } - ++cnt.v_page_count; + atomic_add_int(&cnt.v_page_count, 1); m = PHYS_TO_VM_PAGE(pa); m->phys_addr = pa; m->flags = 0; m->pc = (pa >> PAGE_SHIFT) & PQ_COLORMASK; pmap_page_init(m); + mtx_lock_spin(&vm_page_queue_free_mtx); vm_pageq_enqueue(m->pc + PQ_FREE, m); + mtx_unlock_spin(&vm_page_queue_free_mtx); return (m); } |