Lines Matching defs:swap
35 #include <linux/swap.h>
49 * extends ramfs by the ability to use swap and honor resource limits
107 pgoff_t nr_unswapped; /* how often writepage refused to swap out */
431 * that an entry was not already brought back from swap by a racing thread.
434 * might be reused, and again be SwapCache, using the same swap as before.
437 pgoff_t index, swp_entry_t swap)
439 return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap);
743 * Like delete_from_page_cache, but substitutes swap for page.
764 * Remove swap entry from page cache, free the swap and its page cache.
828 * The easier cases are when the shmem object has nothing in swap, or
860 * has finished, if it hits a row of PAGEVEC_SIZE swap entries.
901 * Remove range of pages and swap entries from page cache, and free them.
1030 /* Page was replaced by swap: retry */
1269 * If swap found in inode, free it and move page from swapcache to filecache.
1315 * Read all the shared memory data that resides in the swap
1316 * device 'type' back into memory, so the swap device can be
1335 * Drop the swaplist mutex while searching the inode for swap;
1362 * Move the page from the page cache to the swap cache.
1369 swp_entry_t swap;
1387 * swap only in response to memory pressure, and not for the writeback
1403 * good idea to continue anyway, once we're pushing into swap. So
1427 swap = get_swap_page(page);
1428 if (!swap.val)
1434 * moved to swap cache, when its pagelock no longer protects
1443 if (add_to_swap_cache(page, swap,
1451 swap_shmem_alloc(swap);
1452 shmem_delete_from_page_cache(page, swp_to_radix_entry(swap));
1461 put_swap_page(page, swap);
1523 static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
1533 page = swap_cluster_readahead(swap, gfp, &vmf);
1611 * shmem_unuse_inode()), it may have been read in earlier from swap, in
1707 swp_entry_t swap;
1711 swap = radix_to_swp_entry(*pagep);
1715 page = lookup_swap_cache(swap, NULL, 0);
1724 page = shmem_swapin(swap, gfp, info, index);
1733 if (!PageSwapCache(page) || page_private(page) != swap.val ||
1734 !shmem_confirm_swap(mapping, index, swap)) {
1746 * physical page after reading from swap.
1748 arch_swap_restore(swap, page);
1757 swp_to_radix_entry(swap), gfp,
1772 swap_free(swap);
1777 if (!shmem_confirm_swap(mapping, index, swap))
1789 * shmem_getpage_gfp - find page in cache, or get from swap, or allocate
1792 * vm. If we swap it in we mark it dirty since we also free the swap
1793 * entry since a page cannot live in both the swap and page cache.
1857 * bring it back from swap or allocate.
2879 * But set_page_dirty so that memory pressure will swap rather
4142 * shmem code (swap-backed and resource-limited) are outweighed by
4143 * their complexity. On systems without swap this code should be
4345 * The tiny !SHMEM case uses ramfs without swap