1 Matching Annotations
- Sep 2024
-
elixir.bootlin.com elixir.bootlin.com
-
static inline unsigned int calc_slab_order(unsigned int size, unsigned int min_order, unsigned int max_order, unsigned int fract_leftover) { unsigned int order; for (order = min_order; order <= max_order; order++) { unsigned int slab_size = (unsigned int)PAGE_SIZE << order; unsigned int rem; rem = slab_size % size; if (rem <= slab_size / fract_leftover) break; } return order; }
Code to choose how many pages to allocate for a new slab to minimize wasted space from the remainder
-