Lines Matching refs:bit_off

336  * @bit_off: chunk offset
341 * next hint. It modifies bit_off and bits in-place to be consumed in the
344 static void pcpu_next_md_free_region(struct pcpu_chunk *chunk, int *bit_off,
347 int i = pcpu_off_to_block_index(*bit_off);
348 int block_off = pcpu_off_to_block_off(*bit_off);
373 *bit_off = pcpu_block_off_to_off(i,
381 *bit_off = (i + 1) * PCPU_BITMAP_BLOCK_BITS - block->right_free;
390 * @bit_off: chunk offset
400 int align, int *bit_off, int *bits)
402 int i = pcpu_off_to_block_index(*bit_off);
403 int block_off = pcpu_off_to_block_off(*bit_off);
432 *bit_off = pcpu_block_off_to_off(i, start);
438 *bit_off = ALIGN(PCPU_BITMAP_BLOCK_BITS - block->right_free,
440 *bits = PCPU_BITMAP_BLOCK_BITS - *bit_off;
441 *bit_off = pcpu_block_off_to_off(i, *bit_off);
447 *bit_off = pcpu_chunk_map_bits(chunk);
452 * based on the metadata blocks and return the offset @bit_off and size in
456 #define pcpu_for_each_md_free_region(chunk, bit_off, bits) \
457 for (pcpu_next_md_free_region((chunk), &(bit_off), &(bits)); \
458 (bit_off) < pcpu_chunk_map_bits((chunk)); \
459 (bit_off) += (bits) + 1, \
460 pcpu_next_md_free_region((chunk), &(bit_off), &(bits)))
462 #define pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) \
463 for (pcpu_next_fit_region((chunk), (alloc_bits), (align), &(bit_off), \
465 (bit_off) < pcpu_chunk_map_bits((chunk)); \
466 (bit_off) += (bits), \
467 pcpu_next_fit_region((chunk), (alloc_bits), (align), &(bit_off), \
655 * @bit_off: chunk offset
668 static void pcpu_block_update_scan(struct pcpu_chunk *chunk, int bit_off,
671 int s_off = pcpu_off_to_block_off(bit_off);
679 s_index = pcpu_off_to_block_index(bit_off);
704 int bit_off, bits;
708 bit_off = chunk_md->scan_hint_start + chunk_md->scan_hint;
713 bit_off = chunk_md->first_free;
718 pcpu_for_each_md_free_region(chunk, bit_off, bits)
719 pcpu_block_update(chunk_md, bit_off, bit_off + bits);
758 * @bit_off: chunk offset
765 static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off,
780 s_index = pcpu_off_to_block_index(bit_off);
781 e_index = pcpu_off_to_block_index(bit_off + bits - 1);
782 s_off = pcpu_off_to_block_off(bit_off);
783 e_off = pcpu_off_to_block_off(bit_off + bits - 1) + 1;
877 bit_off,
878 bit_off + bits))
889 bit_off,
890 bit_off + bits))
897 * @bit_off: chunk offset
912 static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off,
927 s_index = pcpu_off_to_block_index(bit_off);
928 e_index = pcpu_off_to_block_index(bit_off + bits - 1);
929 s_off = pcpu_off_to_block_off(bit_off);
930 e_off = pcpu_off_to_block_off(bit_off + bits - 1) + 1;
1012 * @bit_off: chunk offset
1022 static bool pcpu_is_populated(struct pcpu_chunk *chunk, int bit_off, int bits,
1027 page_start = PFN_DOWN(bit_off * PCPU_MIN_ALLOC_SIZE);
1028 page_end = PFN_UP((bit_off + bits) * PCPU_MIN_ALLOC_SIZE);
1062 int bit_off, bits, next_off;
1070 bit_off = ALIGN(chunk_md->contig_hint_start, align) -
1072 if (bit_off + alloc_bits > chunk_md->contig_hint)
1075 bit_off = pcpu_next_hint(chunk_md, alloc_bits);
1077 pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) {
1078 if (!pop_only || pcpu_is_populated(chunk, bit_off, bits,
1082 bit_off = next_off;
1086 if (bit_off == pcpu_chunk_map_bits(chunk))
1089 return bit_off;
1153 * @start: bit_off to start searching
1173 int bit_off, end, oslot;
1184 bit_off = pcpu_find_zero_area(chunk->alloc_map, end, start, alloc_bits,
1186 if (bit_off >= end)
1193 bitmap_set(chunk->alloc_map, bit_off, alloc_bits);
1196 set_bit(bit_off, chunk->bound_map);
1197 bitmap_clear(chunk->bound_map, bit_off + 1, alloc_bits - 1);
1198 set_bit(bit_off + alloc_bits, chunk->bound_map);
1203 if (bit_off == chunk_md->first_free)
1207 bit_off + alloc_bits);
1209 pcpu_block_update_hint_alloc(chunk, bit_off, alloc_bits);
1213 return bit_off * PCPU_MIN_ALLOC_SIZE;
1230 int bit_off, bits, end, oslot, freed;
1237 bit_off = off / PCPU_MIN_ALLOC_SIZE;
1241 bit_off + 1);
1242 bits = end - bit_off;
1243 bitmap_clear(chunk->alloc_map, bit_off, bits);
1251 chunk_md->first_free = min(chunk_md->first_free, bit_off);
1253 pcpu_block_update_hint_free(chunk, bit_off, bits);