diff options
author | alc <alc@FreeBSD.org> | 2003-01-14 06:57:03 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-01-14 06:57:03 +0000 |
commit | c7ca47fcc7cd393f626b58b6b5e5c6d1c05494d9 (patch) | |
tree | 24db1344150e130dd55fba25b85388b5264f1cb1 /sys/vm | |
parent | 8f97c15f80b1b5c708048e55765ff56df527eb82 (diff) | |
download | FreeBSD-src-c7ca47fcc7cd393f626b58b6b5e5c6d1c05494d9.zip FreeBSD-src-c7ca47fcc7cd393f626b58b6b5e5c6d1c05494d9.tar.gz |
- Update vm_pageout_deficit using atomic operations. It's a simple
counter outside the scope of existing locks.
- Eliminate a redundant clearing of vm_pageout_deficit.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_pageout.c | 4 |
2 files changed, 3 insertions, 5 deletions
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; } } |