| /linux/Documentation/mm/ |
| H A D | swap-table.rst | 6 Swap Table 9 Swap table implements swap cache as a per-cluster swap cache value array. 11 Swap Entry 14 A swap entry contains the information required to serve the anonymous page 17 Swap entry is encoded as two parts: swap type and swap offset. 19 The swap type indicates which swap device to use. 20 The swap offset is the offset of the swap file to read the page data from. 22 Swap Cache 25 Swap cache is a map to look up folios using swap entry as the key. The result 26 value can have three possible types depending on which stage of this swap entry [all …]
|
| /linux/mm/ |
| H A D | swap.h | 8 #include <linux/swap.h> /* for MAX_SWAPFILES_SHIFT, struct swap_info_struct */ 23 /* Swap table marker, 0x1 means shadow, 0x2 means PFN (SWP_TB_PFN_MARK) */ 42 * We use this to track usage of a cluster. A cluster is a block of swap disk 54 * elements corresponding to the swap cluster. 59 atomic_long_t __rcu *table; /* Swap table entries, see mm/swap_table.h */ 60 unsigned int *extend_table; /* For large swap count, protected by ci->lock */ 62 struct swap_memcg_table *memcg_table; /* Swap table entries' cgroup record */ 106 * valid, and protect the swap device with reference count or locks. 142 * Nothing modifies swap cache in an IRQ context. All access to in __swap_cluster_lock() 143 * swap cache is wrapped by swap_cache_* helpers, and swap cache in __swap_cluster_lock() [all …]
|
| H A D | swap_state.c | 6 * Swap reorganised 29.12.95, Stephen Tweedie 14 #include <linux/swap.h> 29 #include "swap.h" 31 /* Swap readahead cluster size, as a power of 2 pages. */ 76 printk("%lu pages in swap cache\n", total_swapcache_pages()); in show_swap_cache_info() 77 printk("Free swap = %ldkB\n", K(get_nr_swap_pages())); in show_swap_cache_info() 78 printk("Total swap = %lukB\n", K(total_swap_pages)); in show_swap_cache_info() 82 * swap_cache_get_folio - Looks up a folio in the swap cache. 83 * @entry: swap entry used for the lookup. 87 * Context: Caller must ensure @entry is valid and protect the swap device [all …]
|
| H A D | swapfile.c | 6 * Swap reorganised 29.12.95, Stephen Tweedie 17 #include <linux/swap.h> 50 #include "swap.h" 61 * lazily allocated & freed swap device info struts, and SWP_USED indicates 70 * Some modules use swappable objects and may try to swap them out under 72 * check to see if any swap space is available. 83 static const char Bad_file[] = "Bad swap file entry "; 84 static const char Bad_offset[] = "Bad swap offset entry "; 148 * if one swap device is on the available plist, so the atomic can 166 /* Reclaim the swap entry anyway if possible */ [all …]
|
| H A D | page_io.c | 7 * Swap reorganised 29.12.95, 10 * Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie 18 #include <linux/swap.h> 29 #include "swap.h" 201 * We may have stale swap cache pages in memory: notice 222 * Use the swap table zero mark to avoid doing IO for zero-filled in swap_writeout() 234 * swap entries. in swap_writeout() 322 struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); in swap_can_merge() 334 struct swap_info_struct *sis = __swap_entry_to_info(folio->swap); in swap_add_folio() 390 * Return the count of contiguous swap entries that share the same [all …]
|
| /linux/Documentation/power/ |
| H A D | swsusp-and-swap-files.rst | 2 Using swap files with software suspend (swsusp) 7 The Linux kernel handles swap files almost in the same way as it handles swap 8 partitions and there are only two differences between these two types of swap 10 (1) swap files need not be contiguous, 11 (2) the header of a swap file is not in the first block of the partition that 13 already taken care of by the swap-handling code, but (2) has to be taken into 16 In principle the location of a swap file's header may be determined with the 18 filesystem holding the swap file to be mounted, and if this filesystem is 20 identify a swap file swsusp uses the name of the partition that holds the file 21 and the offset from the beginning of the partition at which the swap file's [all …]
|
| H A D | swsusp.rst | 2 Swap suspend 34 Swap partition: 38 Swap file: 51 - If you would like to write hibernation image to swap and then suspend 102 powerdowns. You must explicitly specify the swap partition to resume from with 185 encryption) and arbitrary backends for writing the image (eg to swap 224 * SUSPEND all but swap device and parents 227 * SUSPEND swap device and parents 230 Oh no, that does not work, if swap device or its parents uses DMA, 233 * SUSPEND all but swap device and parents [all …]
|
| H A D | userland-swsusp.rst | 76 return the amount of available swap in bytes 81 allocate a swap page from the resume partition 83 will contain the swap page offset if the call is successful) 86 free all swap pages allocated by 91 units) from the beginning of the partition at which the swap header is 94 containing the resume device specification and the offset); for swap 96 swap files (see Documentation/power/swsusp-and-swap-files.rst for 130 and all swap pages allocated with SNAPSHOT_ALLOC_SWAP_PAGE (if any). 137 snapshot image from/to the kernel will use a swap partition, called the resume 138 partition, or a swap file as storage space (if a swap file is used, the resume
|
| H A D | swsusp-dmcrypt.rst | 17 the swap device(s) and the boot partition which may contain a mini 21 At this point you want to encrypt your swap, too. Still you want to 27 swap device. 30 a way that the swap device you suspend to/resume from has 33 to always set up this swap device first with dmsetup, so that 56 card contains at least the encrypted swap setup in a file 67 initrd that allows you to resume from encrypted swap and that 126 pcmcia flash disk. If this succeeds we need to reset the swap 133 Otherwise we just remove the encrypted swap device and leave it to the
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | zswap.rst | 8 Zswap is a lightweight compressed cache for swap pages. It takes pages that are 11 for potentially reduced swap I/O. This trade-off can also result in a 13 faster than reads from a swap device. 20 dramatically reduce their swap I/O pressure, avoiding heavy handed I/O 23 * Users with SSDs as swap devices can extend the life of the device by 26 Zswap evicts pages from compressed cache on an LRU basis to the backing swap 45 pages out of the compressed pool, a swapoff on the swap device(s) will 52 Zswap receives pages for compression from the swap subsystem and is able to 54 the backing swap device in the case that the compressed pool is full. 62 When a swap page is passed from swapout to zswap, zswap maintains a mapping of [all …]
|
| /linux/include/linux/ |
| H A D | swap.h | 19 #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ 21 #define SWAP_FLAG_DISCARD 0x10000 /* enable discard for swap */ 22 #define SWAP_FLAG_DISCARD_ONCE 0x20000 /* discard swap area at swapon-time */ 36 * be swapped to. The swap type and the offset into that swap type are 45 * Use some of the swap files numbers for other purposes. This 114 * Magic header for a swap area. The first part of the union is 115 * what the swap magic looks like for the old (limited to 128MB) 116 * swap area format, the second part of the union adds - in the 120 * Having the magic at the end of the PAGE_SIZE makes detecting swap 128 char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ [all …]
|
| /linux/scripts/coccinelle/misc/ |
| H A D | swap.cocci | 3 /// Check for opencoded swap() implementation. 9 // Keywords: swap 64 + swap(a, b) 76 + swap(a, b) 85 swap(...); 90 swap(...); 95 swap(...); 104 coccilib.report.print_report(p[0], "WARNING opportunity for swap()") 110 coccilib.org.print_todo(p[0], "WARNING opportunity for swap()") 116 coccilib.report.print_report(p[0], "WARNING opportunity for swap()") [all …]
|
| /linux/arch/csky/abiv1/inc/abi/ |
| H A D | pgtable-bits.h | 13 /* We borrow bit 9 to store the exclusive marker in swap PTEs. */ 32 * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that 35 * Format of swap PTE: 38 * bit 2 - 5: swap type[0 - 3] 41 * bit 8: swap type[4] 43 * bit 10 - 31: swap offset
|
| /linux/arch/csky/abiv2/inc/abi/ |
| H A D | pgtable-bits.h | 13 /* We borrow bit 7 to store the exclusive marker in swap PTEs. */ 32 * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that 35 * Format of swap PTE: 38 * bit 2 - 6: swap type 40 * bit 8: swap offset[0] 43 * bit 11 - 31: swap offset[1 - 21]
|
| /linux/Documentation/ABI/testing/ |
| H A D | sysfs-kernel-mm-swap | 1 What: /sys/kernel/mm/swap/ 6 What: /sys/kernel/mm/swap/vma_ra_enabled 9 Description: Enable/disable VMA based swap readahead. 11 If set to true, the VMA based swap readahead algorithm 13 VMA, and the global swap readahead algorithm will be 15 false, the global swap readahead algorithm will be
|
| /linux/arch/arm/vdso/ |
| H A D | vdsomunge.c | 101 static Elf32_Word read_elf_word(Elf32_Word word, bool swap) in read_elf_word() argument 103 return swap ? swab32(word) : word; in read_elf_word() 106 static Elf32_Half read_elf_half(Elf32_Half half, bool swap) in read_elf_half() argument 108 return swap ? swab16(half) : half; in read_elf_half() 111 static void write_elf_word(Elf32_Word val, Elf32_Word *dst, bool swap) in write_elf_word() argument 113 *dst = swap ? swab32(val) : val; in write_elf_word() 125 bool swap; in main() local 159 swap = inhdr->e_ident[EI_DATA] != HOST_ORDER; in main() 161 if (read_elf_half(inhdr->e_type, swap) != ET_DYN) in main() 164 if (read_elf_half(inhdr->e_machine, swap) != EM_ARM) in main() [all …]
|
| /linux/drivers/net/wireless/ath/ath10k/ |
| H A D | swap.c | 6 /* This file has implementation for code swap logic. With code swap feature, 28 /* Parse swap bin and copy the content to host allocated memory. in ath10k_swap_code_seg_fill() 47 ath10k_err(ar, "refusing an invalid swap file\n"); in ath10k_swap_code_seg_fill() 64 ath10k_err(ar, "failed to parse invalid swap file\n"); in ath10k_swap_code_seg_fill() 98 ath10k_err(ar, "refusing code swap bin because it is too big %zu > %d\n", in ath10k_swap_code_seg_alloc() 133 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot found firmware code swap binary\n"); in ath10k_swap_code_seg_configure() 141 ath10k_err(ar, "failed to write Code swap segment information (%d)\n", in ath10k_swap_code_seg_configure() 178 ath10k_err(ar, "failed to allocate fw code swap segment\n"); in ath10k_swap_code_seg_init() 186 ath10k_warn(ar, "failed to initialize fw code swap segment: %d\n", in ath10k_swap_code_seg_init()
|
| /linux/lib/ |
| H A D | sort.c | 43 * swap_words_32 - swap two elements in 32-bit chunks 44 * @a: pointer to the first element to swap 45 * @b: pointer to the second element to swap 66 * swap_words_64 - swap two elements in 64-bit chunks 67 * @a: pointer to the first element to swap 68 * @b: pointer to the second element to swap 102 * swap_bytes - swap two elements a byte at a time 103 * @a: pointer to the first element to swap 104 * @b: pointer to the second element to swap 130 swap_func_t swap; member [all …]
|
| /linux/Documentation/admin-guide/cgroup-v1/ |
| H A D | memory.rst | 46 - accounting anonymous pages, file caches, swap caches usage and limiting them. 48 - optionally, memory+swap usage can be accounted and limited. 70 memory.memsw.usage_in_bytes show current usage for memory+Swap 73 memory.memsw.limit_in_bytes set/show limit of memory+Swap usage 75 memory.memsw.failcnt show the number of memory+Swap hits limits 77 memory.memsw.max_usage_in_bytes show max memory+Swap usage recorded 226 Since page's memcg recorded into swap whatever memsw enabled, the page will 243 2.4 Swap Extension 246 Swap usage is always recorded for each of cgroup. Swap Extension allows you to 254 memsw means memory+swap. Usage of memory+swap is limited by [all …]
|
| H A D | memcg_test.rst | 47 Called when swp_entry's refcnt goes down to 0. A charge against swap 72 4.1 Swap-in. 73 At swap-in, the page is taken from swap-cache. There are 2 cases. 79 4.2 Swap-out. 80 At swap-out, typical state transition is below. 82 (a) add to swap cache. (marked as SwapCache) 86 (c) write back to swap. 87 (d) delete from swap cache. (remove from SwapCache) 119 - Both on radix-tree and SwapCache. This happens at swap-in 120 and swap-out, [all …]
|
| /linux/fs/iomap/ |
| H A D | swapfile.c | 7 #include <linux/swap.h> 22 * Collect physical extents for this swap file. Physical extents reported to 23 * the swap code must be trimmed to align to a page boundary. The logical 25 * page numbers of the swap device to the physical page-aligned extents. 56 * Calculate how much swap space we're adding; the first page contains in iomap_swapfile_add_extent() 57 * the swap header and doesn't count. The mm still wants that first in iomap_swapfile_add_extent() 90 * Accumulate iomaps for this swap file. We have to accumulate iomaps because 91 * swap only cares about contiguous page-aligned physical extents and makes no 115 /* Only one bdev per swap file. */ in iomap_swapfile_iter() 137 * Iterate a swap file's iomaps to construct physical extents that can be
|
| /linux/arch/sh/include/mach-se/mach/ |
| H A D | mrshpc.h | 25 /* common mode & bus width 16bit SWAP = 1*/ in mrshpc_setup_windows() 28 /* common mode & bus width 16bit SWAP = 0*/ in mrshpc_setup_windows() 34 /* attribute mode & bus width 16bit SWAP = 1*/ in mrshpc_setup_windows() 37 /* attribute mode & bus width 16bit SWAP = 0*/ in mrshpc_setup_windows() 44 __raw_writew(0x0a00, MRSHPC_IOWCR2); /* bus width 16bit SWAP = 1*/ in mrshpc_setup_windows() 46 __raw_writew(0x0200, MRSHPC_IOWCR2); /* bus width 16bit SWAP = 0*/ in mrshpc_setup_windows()
|
| /linux/include/linux/mtd/ |
| H A D | cfi_endian.h | 29 #define cpu_to_cfi16(map, x) _cpu_to_cfi(16, (map)->swap, (x)) 30 #define cpu_to_cfi32(map, x) _cpu_to_cfi(32, (map)->swap, (x)) 31 #define cpu_to_cfi64(map, x) _cpu_to_cfi(64, (map)->swap, (x)) 32 #define cfi16_to_cpu(map, x) _cfi_to_cpu(16, (map)->swap, (x)) 33 #define cfi32_to_cpu(map, x) _cfi_to_cpu(32, (map)->swap, (x)) 34 #define cfi64_to_cpu(map, x) _cfi_to_cpu(64, (map)->swap, (x))
|
| /linux/tools/mm/ |
| H A D | thp_swap_allocator_test.c | 6 * can correctly get swap slots to swap out as a whole instead of 7 * being split. It randomly releases swap entries through madvise 12 * swap device by: 63 * currently don't support large folios swap-in. 168 /* iterations with newly created mTHP, swap-in, and swap-out */ in main() 183 * since large folio swap-in isn't supported yet. Once we support in main() 184 * mTHP swap-in, we'll likely need to reduce MEMSIZE_MTHP and in main()
|
| /linux/sound/soc/codecs/ |
| H A D | rt5665.c | 953 SOC_DAPM_ENUM("IF1_1 01 ADC Swap Mux", rt5665_if1_1_01_adc_enum); 956 SOC_DAPM_ENUM("IF1_1 23 ADC Swap Mux", rt5665_if1_1_23_adc_enum); 959 SOC_DAPM_ENUM("IF1_1 45 ADC Swap Mux", rt5665_if1_1_45_adc_enum); 962 SOC_DAPM_ENUM("IF1_1 67 ADC Swap Mux", rt5665_if1_1_67_adc_enum); 965 SOC_DAPM_ENUM("IF1_2 01 ADC Swap Mux", rt5665_if1_2_01_adc_enum); 968 SOC_DAPM_ENUM("IF1_2 23 ADC1 Swap Mux", rt5665_if1_2_23_adc_enum); 971 SOC_DAPM_ENUM("IF1_2 45 ADC1 Swap Mux", rt5665_if1_2_45_adc_enum); 974 SOC_DAPM_ENUM("IF1_2 67 ADC1 Swap Mux", rt5665_if1_2_67_adc_enum); 977 SOC_DAPM_ENUM("IF2_1 DAC Swap Source", rt5665_if2_1_dac_enum); 980 SOC_DAPM_ENUM("IF2_1 ADC Swap Sourc [all...] |