static inline long __zone_watermark_unusable_free(struct zone *z, unsigned int order, unsigned int alloc_flags) { const bool alloc_harder = (alloc_flags & (ALLOC_HARDER|ALLOC_OOM));
(1 << order) - 1が使用不可能なページ数の初期値となる。
long unusable_free = (1 << order) - 1;
ALLOC_HARDERかALLOC_OOMを指定しない限り、MIGRATE_HIGHATOMICの領域は使わない。
/* * If the caller does not have rights to ALLOC_HARDER then subtract * the high-atomic reserves. This will over-estimate the size of the * atomic reserve but it avoids a search. */ if (likely(!alloc_harder)) unusable_free += z->nr_reserved_highatomic;
ALLOC_CMAを指定しない限り、MIGRATE_CMAの領域は使わない。
#ifdef CONFIG_CMA /* If allocation can't use CMA areas don't use free CMA pages */ if (!(alloc_flags & ALLOC_CMA)) unusable_free += zone_page_state(z, NR_FREE_CMA_PAGES); #endif return unusable_free; }