Lines Matching +full:- +full:- +full:retry
1 // SPDX-License-Identifier: GPL-2.0
20 return -EINVAL; in shuffle_param_set()
21 if (*(bool *)kp->arg) in shuffle_param_set()
69 * Fisher-Yates shuffle the freelist which prescribes iterating through an
71 * the span, end_pfn - start_pfn.
74 * of bias in the distribution, like modulo bias or pseudo-random number
83 unsigned long start_pfn = z->zone_start_pfn; in __shuffle_zone()
88 spin_lock_irqsave(&z->lock, flags); in __shuffle_zone()
92 int migratetype, retry; in __shuffle_zone() local
96 * We expect page_i, in the sub-range of a zone being added in __shuffle_zone()
105 for (retry = 0; retry < SHUFFLE_RETRY; retry++) { in __shuffle_zone()
108 * a swap target. If the selected pfn is a hole, retry in __shuffle_zone()
112 j = z->zone_start_pfn + in __shuffle_zone()
113 ALIGN_DOWN(get_random_long() % z->spanned_pages, in __shuffle_zone()
119 if (retry >= SHUFFLE_RETRY) { in __shuffle_zone()
135 list_swap(&page_i->lru, &page_j->lru); in __shuffle_zone()
137 pr_debug("%s: swap: %#lx -> %#lx\n", __func__, i, j); in __shuffle_zone()
141 spin_unlock_irqrestore(&z->lock, flags); in __shuffle_zone()
143 spin_lock_irqsave(&z->lock, flags); in __shuffle_zone()
146 spin_unlock_irqrestore(&z->lock, flags); in __shuffle_zone()
150 * __shuffle_free_memory - reduce the predictability of the page allocator
157 for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++) in __shuffle_free_memory()
178 rand_bits--; in shuffle_pick_tail()