Lines Matching defs:slots
3 * Manage cache of swap slots to be used for and returned from
10 * We allocate the swap slots from the global pool and put
17 * lock. We do not reuse the returned slots directly but
19 * allows the slots to coalesce and reduce fragmentation.
25 * The swap slots cache is protected by a mutex instead of
26 * a spin lock as when we search for slots with scan_swap_map,
43 /* Serialize swap slots cache enable/disable operations */
114 swp_entry_t *slots;
121 slots = kvcalloc(SWAP_SLOTS_CACHE_SIZE, sizeof(swp_entry_t),
123 if (!slots)
128 if (cache->slots) {
132 kvfree(slots);
146 * !cache->slots or !cache->slots_ret to know if it is safe to acquire
151 cache->slots = slots;
161 if (cache->slots) {
163 swapcache_free_entries(cache->slots + cache->cur, cache->nr);
166 if (free_slots && cache->slots) {
167 kvfree(cache->slots);
168 cache->slots = NULL;
181 * left over slots are in cache when we remove
184 * on swap slots when allocating memory and need
185 * to return swap slots to global pool.
198 * fill any swap slots in slots cache of such cpu.
199 * There are no slots on such cpu that need to be drained.
222 "without swap slots cache.\n", __func__))
242 cache->slots, 0);
271 if (likely(check_cache_active() && cache->slots)) {
273 if (cache->slots) {
276 entry = cache->slots[cache->cur];
277 cache->slots[cache->cur++].val = 0;