summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_bio.c6
-rw-r--r--sys/vm/vm_page.c4
-rw-r--r--sys/vm/vm_pageout.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index a4e5b6e..3293ab4 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2757,7 +2757,8 @@ allocbuf(struct buf *bp, int size)
VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (m == NULL) {
VM_WAIT;
- vm_pageout_deficit += desiredpages - bp->b_npages;
+ atomic_add_int(&vm_pageout_deficit,
+ desiredpages - bp->b_npages);
} else {
vm_page_lock_queues();
vm_page_wakeup(m);
@@ -3488,7 +3489,8 @@ tryagain:
VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
vm_object_unlock(kernel_object);
if (!p) {
- vm_pageout_deficit += (to - from) >> PAGE_SHIFT;
+ atomic_add_int(&vm_pageout_deficit,
+ (to - from) >> PAGE_SHIFT);
VM_WAIT;
goto tryagain;
}
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 56abce4..bbdc77b 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -805,7 +805,7 @@ loop:
if (cnt.v_cache_count > 0)
printf("vm_page_alloc(NORMAL): missing pages on cache queue: %d\n", cnt.v_cache_count);
#endif
- vm_pageout_deficit++;
+ atomic_add_int(&vm_pageout_deficit, 1);
pagedaemon_wakeup();
return (NULL);
}
@@ -821,7 +821,7 @@ loop:
*/
mtx_unlock_spin(&vm_page_queue_free_mtx);
splx(s);
- vm_pageout_deficit++;
+ atomic_add_int(&vm_pageout_deficit, 1);
pagedaemon_wakeup();
return (NULL);
}
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 84d4cac..ec759db 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -694,8 +694,7 @@ vm_pageout_scan(int pass)
*/
vm_pageout_pmap_collect();
- addl_page_shortage_init = vm_pageout_deficit;
- vm_pageout_deficit = 0;
+ addl_page_shortage_init = atomic_readandclear_int(&vm_pageout_deficit);
/*
* Calculate the number of pages we want to either free or move
@@ -1479,7 +1478,6 @@ vm_pageout()
cnt.v_pdwakeups++;
splx(s);
vm_pageout_scan(pass);
- vm_pageout_deficit = 0;
}
}
OpenPOWER on IntegriCloud