/* enough to cover all DEFINE_PER_CPUs in modules */ #ifdef CONFIG_MODULES #define PERCPU_MODULE_RESERVE (8 << 10) #else #define PERCPU_MODULE_RESERVE 0 #endif
/* minimum unit size, also is the maximum supported allocation size */ #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10)
/* minimum allocation size and shift in bytes */ #define PCPU_MIN_ALLOC_SHIFT 2 #define PCPU_MIN_ALLOC_SIZE (1 << PCPU_MIN_ALLOC_SHIFT)
/* * The PCPU_BITMAP_BLOCK_SIZE must be the same size as PAGE_SIZE as the * updating of hints is used to manage the nr_empty_pop_pages in both * the chunk and globally.
*/ #define PCPU_BITMAP_BLOCK_SIZE PAGE_SIZE #define PCPU_BITMAP_BLOCK_BITS (PCPU_BITMAP_BLOCK_SIZE >> \
PCPU_MIN_ALLOC_SHIFT)
/* * Percpu allocator can serve percpu allocations before slab is * initialized which allows slab to depend on the percpu allocator. * The following parameter decide how much resource to preallocate * for this. Keep PERCPU_DYNAMIC_RESERVE equal to or larger than * PERCPU_DYNAMIC_EARLY_SIZE.
*/ #define PERCPU_DYNAMIC_EARLY_SIZE (20 << PERCPU_DYNAMIC_SIZE_SHIFT)
/* * PERCPU_DYNAMIC_RESERVE indicates the amount of free area to piggy * back on the first chunk for dynamic percpu allocation if arch is * manually allocating and mapping it for faster access (as a part of * large page mapping for example). * * The following values give between one and two pages of free space * after typical minimal boot (2-way SMP, single disk and NIC) with * both defconfig and a distro config on x86_64 and 32. More * intelligent way to determine this would be nice.
*/ #if BITS_PER_LONG > 32 #define PERCPU_DYNAMIC_RESERVE (28 << PERCPU_DYNAMIC_SIZE_SHIFT) #else #define PERCPU_DYNAMIC_RESERVE (20 << PERCPU_DYNAMIC_SIZE_SHIFT) #endif