zswap.c (97157d8908bc10dec22cc4479f4c5cc7db58a12c) | zswap.c (3d2c908768877714a354ee6d7bf93e801400d5e2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * zswap.c - zswap driver file 4 * 5 * zswap is a cache that takes pages that are in the process 6 * of being swapped out and attempts to compress and store them in a 7 * RAM-based memory pool. This can result in a significant I/O reduction on 8 * the swap device and, in the case where decompressing from RAM is faster --- 1176 unchanged lines hidden (view full) --- 1185 unsigned long *page; 1186 1187 page = (unsigned long *)ptr; 1188 memset_l(page, value, PAGE_SIZE / sizeof(unsigned long)); 1189} 1190 1191bool zswap_store(struct folio *folio) 1192{ | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * zswap.c - zswap driver file 4 * 5 * zswap is a cache that takes pages that are in the process 6 * of being swapped out and attempts to compress and store them in a 7 * RAM-based memory pool. This can result in a significant I/O reduction on 8 * the swap device and, in the case where decompressing from RAM is faster --- 1176 unchanged lines hidden (view full) --- 1185 unsigned long *page; 1186 1187 page = (unsigned long *)ptr; 1188 memset_l(page, value, PAGE_SIZE / sizeof(unsigned long)); 1189} 1190 1191bool zswap_store(struct folio *folio) 1192{ |
1193 swp_entry_t swp = folio_swap_entry(folio); | 1193 swp_entry_t swp = folio->swap; |
1194 int type = swp_type(swp); 1195 pgoff_t offset = swp_offset(swp); 1196 struct page *page = &folio->page; 1197 struct zswap_tree *tree = zswap_trees[type]; 1198 struct zswap_entry *entry, *dupentry; 1199 struct scatterlist input, output; 1200 struct crypto_acomp_ctx *acomp_ctx; 1201 struct obj_cgroup *objcg = NULL; --- 163 unchanged lines hidden (view full) --- 1365 pool = zswap_pool_last_get(); 1366 if (pool) 1367 queue_work(shrink_wq, &pool->shrink_work); 1368 goto reject; 1369} 1370 1371bool zswap_load(struct folio *folio) 1372{ | 1194 int type = swp_type(swp); 1195 pgoff_t offset = swp_offset(swp); 1196 struct page *page = &folio->page; 1197 struct zswap_tree *tree = zswap_trees[type]; 1198 struct zswap_entry *entry, *dupentry; 1199 struct scatterlist input, output; 1200 struct crypto_acomp_ctx *acomp_ctx; 1201 struct obj_cgroup *objcg = NULL; --- 163 unchanged lines hidden (view full) --- 1365 pool = zswap_pool_last_get(); 1366 if (pool) 1367 queue_work(shrink_wq, &pool->shrink_work); 1368 goto reject; 1369} 1370 1371bool zswap_load(struct folio *folio) 1372{ |
1373 swp_entry_t swp = folio_swap_entry(folio); | 1373 swp_entry_t swp = folio->swap; |
1374 int type = swp_type(swp); 1375 pgoff_t offset = swp_offset(swp); 1376 struct page *page = &folio->page; 1377 struct zswap_tree *tree = zswap_trees[type]; 1378 struct zswap_entry *entry; 1379 struct scatterlist input, output; 1380 struct crypto_acomp_ctx *acomp_ctx; 1381 u8 *src, *dst, *tmp; --- 246 unchanged lines hidden --- | 1374 int type = swp_type(swp); 1375 pgoff_t offset = swp_offset(swp); 1376 struct page *page = &folio->page; 1377 struct zswap_tree *tree = zswap_trees[type]; 1378 struct zswap_entry *entry; 1379 struct scatterlist input, output; 1380 struct crypto_acomp_ctx *acomp_ctx; 1381 u8 *src, *dst, *tmp; --- 246 unchanged lines hidden --- |