Lines Matching full:swap
42 * New Swap System
48 * to arbitrarily small or arbitrarily large swap spaces and an almost
53 * - on the fly reallocation of swap during putpages. The new system
54 * does not try to keep previously allocated swap blocks for dirty
57 * - on the fly deallocation of swap
59 * - No more garbage collection required. Unnecessarily allocated swap
62 * removal of invalidated swap blocks when a page is destroyed
138 * on-disk swap block (or SWAPBLK_NONE). The collection of these
155 static MALLOC_DEFINE(M_VMPGDATA, "vm_pgdata", "swap pager private data");
159 static int nswapdev; /* Number of swap devices */
161 static struct sx swdev_syscall_lock; /* serialize swap(on|off) */
167 static SYSCTL_NODE(_vm_stats, OID_AUTO, swap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
168 "VM swap stats");
172 "Amount of swap storage needed to back all allocated anonymous memory.");
175 "Total amount of available swap storage.");
183 "Actual size of swap metadata zone");
186 "Maximum amount of swap supported");
191 "Number of pages that deferred freeing swap space");
315 printf("uid %d, pid %d: swap reservation "
387 static int swap_pager_full = 2; /* swap space exhaustion (task killing) */
388 static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/
397 "Maximum running async swap ops");
401 "Swap Fragmentation Info");
422 * pagerops for OBJT_SWAP - "swap pager". Some ops are also global procedure
456 .pgo_pageunswapped = swap_pager_unswapped, /* remove swap related to page */
470 "Maximum size of a swap block in pages");
482 * Swap bitmap functions
540 PCTRIE_DEFINE(SWAP, swblk, p, swblk_trie_alloc, swblk_trie_free);
633 * about to run out of swap space, using lowat/hiwat hysteresis.
646 printf("swap_pager: out of swap space\n");
657 * SWAP_PAGER_INIT() - initialize the swap pager!
680 * defined MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are
681 * constrained by the swap device interleave stripe size.
689 * SWAP_PAGER_SWAP_INIT() - swap pager initialization from pageout process
700 * Number of in-transit swap bp operations. Don't
707 * our pageout I/O. The value 4 works well for one or two active swap
710 * with three or four active swap devices since the system does not
712 * at least 2 per swap devices, and 4 is a pretty good value if you
713 * have one NFS swap device due to the command/ack latency over NFS.
756 printf("Swap blk zone entries changed from %lu to %lu.\n",
762 printf("Cannot reserve swap pctrie zone, "
849 * SWAP_PAGER_DEALLOC() - remove swap metadata from object
851 * The swap backing for the object is destroyed. The code is
882 * the swap meta data. We do not attempt to free swapblk's still
907 * SWAP PAGER BITMAP ROUTINES *
911 * SWP_PAGER_GETSWAPSPACE() - allocate raw swap space
913 * Allocate swap for up to the requested number of pages. The
914 * starting swap block number (a page index) is returned or
918 * when they configured swap and didn't configure enough.
1005 * SWP_PAGER_FREESWAPSPACE() - free raw swap space
1007 * This routine returns the specified swap blocks back to the bitmap.
1044 * SYSCTL_SWAP_FRAGMENTATION() - produce raw swap space stats
1074 * SWAP_PAGER_FREESPACE() - frees swap blocks associated with a page
1077 * This routine removes swapblk assignments from swap metadata.
1103 * SWAP_PAGER_RESERVE() - reserve swap blocks in object
1105 * Assigns swap blocks to the specified range within the object. The
1106 * swap blocks are not zeroed. Any previous swap assignment is destroyed.
1187 * Free left over swap blocks in source.
1287 * SWAP_PAGER_PAGE_UNSWAPPED() - remove swap backing store related to page
1289 * This removes any associated swap backing store, whether valid or
1293 * which point any associated swap can be freed. MADV_FREE also
1296 * NOTE!!! If the page is clean and the swap was valid, the caller
1347 * swap_pager_getpages() - bring pages in from swap
1379 ("page count %d extends beyond swap block", reqcount));
1448 ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex));
1517 * A final note: in a low swap situation, we cannot deallocate swap
1570 * Assign swap (if necessary) and initiate I/O on the specified pages.
1607 * Assign swap blocks and issue I/O. We reallocate swap on the fly.
1612 /* Maximum I/O size is limited by maximum swap block size. */
1624 /* Get a block of swap of size up to size n. */
1725 * Completion routine for asynchronous reads and writes from/to swap.
1765 * cleanup pages. If an error occurs writing to swap, we are in
1767 * we may be able to recover by reassigning the swap later on. So
1770 * never reallocated as swap. Redirty the page and continue.
1818 * swap in a low-swap situation. I don't think we'd
1837 * A page is only written to swap after a period of
1925 * to a swap device.
1975 * the swap block.
1989 /* Get the page from swap, and restart the scan. */
1995 panic("%s: read from swap failed: %d",
2081 * unless we checked that our object is swap and not
2104 panic("swapoff: failed to locate %d swap blocks",
2114 * SWAP META DATA *
2117 * These routines manipulate the swap metadata stored in the
2120 * Swap metadata is implemented with a global hash and not directly
2157 * SWP_PAGER_META_BUILD() - add swap block to swap meta data for object
2159 * Try to add the specified swapblk to the object's swap metadata. If
2162 * replaces a valid swapblk, empty swap metadata is freed. If memory
2202 printf("swap blk zone exhausted, "
2234 printf("swap pctrie zone exhausted, "
2273 * swap metadata into dstobject.
2351 * SWP_PAGER_META_FREE() - free a range of blocks in the object's swap metadata
2353 * Return freed swap blocks to the swap bitmap, and free emptied swblk
2418 * SWP_PAGER_META_FREE_ALL() - destroy all swap metadata associated with object
2420 * This routine locates and destroys all swap metadata associated with
2437 * SWP_PAGER_METACTL() - misc control of swap meta data.
2440 * assignments in the swap meta data. It returns the swapblk being
2460 * pindex and for which there is a swap block allocated. Returns OBJ_MAX_SIZE
2461 * if are no allocated swap blocks for the object after the requested pindex.
2493 * Find the first index >= pindex that has either a valid page or a swap
2527 * Find the first index >= pindex that has neither a valid page nor a swap
2549 * Is every page in the backing object or swap shadowed in the parent, and
2550 * unbusy and valid in swap?
2674 * Swap metadata may not fit in the KVM if we have physical
2713 * Check that the total amount of swap currently configured does not
2723 printf("warning: total configured swap (%lu pages) "
2727 "or reduce amount of swap.\n");
2872 * We can turn off this swap device safely only if the
2875 * the system doesn't become critically low on swap space.
2880 * On the other hand, not turning swap off on swapoff_all()
2881 * means that we can lose swap data when filesystems go away,
2937 printf("Cannot remove swap device %s (error=%d), "
2940 printf("Swap device %s removed.\n", devname);
3062 "Number of swap devices");
3065 "Swap statistics by device");
3068 * Count the approximate swap usage in pages for a vmspace. The
3069 * shadowed or not yet copied on write swap blocks are not accounted.
3123 .name = "SWAP",
3315 gp = g_new_geomf(&g_swap_class, "swap");
3488 ("swap obj %p writecount %jx dec %jx", object,