Lines Matching defs:alloc_bits
329 * @alloc_bits: size of allocation
337 static int pcpu_next_hint(struct pcpu_block_md *block, int alloc_bits)
348 alloc_bits > block->scan_hint)
409 * @alloc_bits: size of allocation
420 static void pcpu_next_fit_region(struct pcpu_chunk *chunk, int alloc_bits,
433 if (*bits >= alloc_bits)
448 block->contig_hint >= *bits + alloc_bits) {
449 int start = pcpu_next_hint(block, alloc_bits);
451 *bits += alloc_bits + block->contig_hint_start -
463 if (*bits >= alloc_bits)
483 #define pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) \
484 for (pcpu_next_fit_region((chunk), (alloc_bits), (align), &(bit_off), \
488 pcpu_next_fit_region((chunk), (alloc_bits), (align), &(bit_off), \
1094 * @alloc_bits: size of request in allocation units
1110 static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
1121 if (!pcpu_check_block_hint(chunk_md, alloc_bits, align))
1124 bit_off = pcpu_next_hint(chunk_md, alloc_bits);
1126 pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) {
1200 * @alloc_bits: size of request in allocation units
1205 * allocation of @alloc_bits with alignment @align. It needs to scan
1216 static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits,
1231 end = min_t(int, start + alloc_bits + PCPU_BITMAP_BLOCK_BITS,
1233 bit_off = pcpu_find_zero_area(chunk->alloc_map, end, start, alloc_bits,
1242 bitmap_set(chunk->alloc_map, bit_off, alloc_bits);
1246 bitmap_clear(chunk->bound_map, bit_off + 1, alloc_bits - 1);
1247 set_bit(bit_off + alloc_bits, chunk->bound_map);
1249 chunk->free_bytes -= alloc_bits * PCPU_MIN_ALLOC_SIZE;
1256 bit_off + alloc_bits);
1258 pcpu_block_update_hint_alloc(chunk, bit_off, alloc_bits);