Lines Matching defs:swap

37 #include <linux/swap.h>
43 #include "swap.h"
50 * extends ramfs by the ability to use swap and honor resource limits
109 pgoff_t nr_unswapped; /* how often writepage refused to swap out */
490 * that an entry was not already brought back from swap by a racing thread.
493 * might be reused, and again be SwapCache, using the same swap as before.
496 pgoff_t index, swp_entry_t swap)
498 return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap);
828 * Like delete_from_page_cache, but substitutes swap for @folio.
848 * Remove swap entry from page cache, free the swap and its page cache.
914 * The easier cases are when the shmem object has nothing in swap, or
969 * But read a folio back from swap if any of it is within i_size
978 * Remove range of pages and swap entries from page cache, and free them.
1094 /* Page was replaced by swap: retry */
1363 * If swap found in inode, free it and move page from swapcache to filecache.
1392 * Read all the shared memory data that resides in the swap
1393 * device 'type' back into memory, so the swap device can be
1411 * Drop the swaplist mutex while searching the inode for swap;
1437 * Move the page from the page cache to the swap cache.
1446 swp_entry_t swap;
1453 * swap only in response to memory pressure, and not for the writeback
1489 * good idea to continue anyway, once we're pushing into swap. So
1513 swap = folio_alloc_swap(folio);
1514 if (!swap.val)
1520 * moved to swap cache, when its pagelock no longer protects
1529 if (add_to_swap_cache(folio, swap,
1533 swap_shmem_alloc(swap);
1534 shmem_delete_from_page_cache(folio, swp_to_radix_entry(swap));
1543 put_swap_folio(folio, swap);
1605 static struct folio *shmem_swapin(swp_entry_t swap, gfp_t gfp,
1615 page = swap_cluster_readahead(swap, gfp, &vmf);
1716 * shmem_unuse_inode()), it may have been read in earlier from swap, in
1740 entry = old->swap;
1761 new->swap = entry;
1800 struct folio *folio, swp_entry_t swap)
1808 swp_to_radix_entry(swap),
1810 if (old != swp_to_radix_entry(swap))
1821 swap_free(swap);
1840 swp_entry_t swap;
1844 swap = radix_to_swp_entry(*foliop);
1847 if (is_poisoned_swp_entry(swap))
1850 si = get_swap_device(swap);
1852 if (!shmem_confirm_swap(mapping, index, swap))
1859 folio = swap_cache_get_folio(swap, NULL, 0);
1868 folio = shmem_swapin(swap, gfp, info, index);
1878 folio->swap.val != swap.val ||
1879 !shmem_confirm_swap(mapping, index, swap)) {
1891 * folio after reading from swap.
1893 arch_swap_restore(swap, folio);
1902 swp_to_radix_entry(swap), gfp,
1914 swap_free(swap);
1920 if (!shmem_confirm_swap(mapping, index, swap))
1923 shmem_set_folio_swapin_error(inode, index, folio, swap);
1935 * shmem_get_folio_gfp - find page in cache, or get from swap, or allocate
1938 * vm. If we swap it in we mark it dirty since we also free the swap
1939 * entry since a page cannot live in both the swap and page cache.
2020 * Fast cache lookup and swap lookup did not find it: allocate.
3174 * But mark it dirty so that memory pressure will swap rather
4003 "Turning off swap in unprivileged tmpfs mounts unsupported");
4157 err = "Cannot disable swap on remount";
4161 err = "Cannot enable swap on remount if it was disabled on first mount";
4720 * shmem code (swap-backed and resource-limited) are outweighed by
4721 * their complexity. On systems without swap this code should be
4925 * The tiny !SHMEM case uses ramfs without swap