Index: sys/vm/swap_pager.c =================================================================== --- sys/vm/swap_pager.c (revision 238711) +++ sys/vm/swap_pager.c (working copy) @@ -1804,6 +1804,7 @@ static void swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { + static volatile int exhausted; struct swblock *swap; struct swblock **pswap; int idx; @@ -1847,7 +1848,9 @@ mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); if (uma_zone_exhausted(swap_zone)) { - printf("swap zone exhausted, increase kern.maxswzone\n"); + if (atomic_cmpset_rel_int(&exhausted, 0, 1)) + printf("swap zone exhausted, " + "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonex", 10); } else @@ -1856,6 +1859,9 @@ goto retry; } + if (atomic_cmpset_rel_int(&exhausted, 1, 0)) + printf("swap zone ok\n"); + swap->swb_hnext = NULL; swap->swb_object = object; swap->swb_index = pindex & ~(vm_pindex_t)SWAP_META_MASK;