使用 水线位 分配内存 , 相关源码定义在 Linux 内核源码的 linux-4.12\mm\internal.h#475 位置 ;
ALLOC_WMARK_MIN
宏定义 , 表示使用 " 最低水线 " 分配内存 ;
ALLOC_WMARK_LOW
宏定义 , 表示使用 " 低水线 " 分配内存 ;
ALLOC_WMARK_HIGH
宏定义 , 表示使用 " 高水线 " 分配内存 ;
ALLOC_NO_WATERMARKS
宏定义 , 表示使用 分配内存 时 , 不检查水位线 ;
/* The ALLOC_WMARK bits are used as an index to zone->watermark */
#define ALLOC_WMARK_MIN WMARK_MIN
#define ALLOC_WMARK_LOW WMARK_LOW
#define ALLOC_WMARK_HIGH WMARK_HIGH
#define ALLOC_NO_WATERMARKS 0x04 /* don't check watermarks at all */
源码路径 : linux-4.12\mm\internal.h#475
ALLOC_WMARK_MASK
宏定义 , 表示 获取 " 水线位 " 的 掩码 ;
/* Mask to get the watermark bits */
#define ALLOC_WMARK_MASK (ALLOC_NO_WATERMARKS-1)
源码路径 : linux-4.12\mm\internal.h#481
ALLOC_HARDER
宏定义 , 表示 试图更努力的分配内存 ;
ALLOC_HIGH
宏定义 , 表示 设置调用者 __GFP_HIGH
高优先级 ;
ALLOC_CPUSET
宏定义 , 表示 检查 cpuset , 是否允许分配内存页 ;
ALLOC_CMA
宏定义 , 表示 允许 CMA 连续内存分配器 迁移类型 分配内存 ;
#define ALLOC_HARDER 0x10 /* try to alloc harder */
#define ALLOC_HIGH 0x20 /* __GFP_HIGH set */
#define ALLOC_CPUSET 0x40 /* check for correct cpuset */
#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
源码路径 : linux-4.12\mm\internal.h#483
源码如下 :
/* The ALLOC_WMARK bits are used as an index to zone->watermark */
#define ALLOC_WMARK_MIN WMARK_MIN
#define ALLOC_WMARK_LOW WMARK_LOW
#define ALLOC_WMARK_HIGH WMARK_HIGH
#define ALLOC_NO_WATERMARKS 0x04 /* don't check watermarks at all */
/* Mask to get the watermark bits */
#define ALLOC_WMARK_MASK (ALLOC_NO_WATERMARKS-1)
#define ALLOC_HARDER 0x10 /* try to alloc harder */
#define ALLOC_HIGH 0x20 /* __GFP_HIGH set */
#define ALLOC_CPUSET 0x40 /* check for correct cpuset */
#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
源码路径 : linux-4.12\mm\internal.h#475